From d17fac8083fe16e6acf52c274168f86f01ffd2b1 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 15 Apr 2023 09:23:15 -0400 Subject: [PATCH] Fixing docker install. Fixes #163 (#164) * Fixing docker install. Fixes #163 * Add letsencrypt guide. --------- Co-authored-by: Nutomic --- src/en/administration/install_docker.md | 32 +++++++++++-------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/en/administration/install_docker.md b/src/en/administration/install_docker.md index c590f27..763cb23 100644 --- a/src/en/administration/install_docker.md +++ b/src/en/administration/install_docker.md @@ -16,39 +16,35 @@ mkdir -p volumes/pictrs sudo chown -R 991:991 volumes/pictrs ``` -Open up your `docker-compose.yml`, and make sure `LEMMY_EXTERNAL_HOST` for `lemmy-ui` is set to your correct host. - -``` -- LEMMY_INTERNAL_HOST=lemmy:8536 -- LEMMY_EXTERNAL_HOST=your-domain.com -- LEMMY_HTTPS=false -``` - If you'd like a different database password, you should also change it in the `docker-compose.yml` **before** your first run. After this, have a look at the [config file](configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname, and possibly the db password. Then run: `docker-compose up -d` -You can access the lemmy-ui at `http://localhost:1235` +You can access the lemmy-ui at `http://localhost:80` -To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/nginx.conf), could be setup with: +To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. You can use the following simple proxy: -```bash -wget https://raw.githubusercontent.com/LemmyNet/lemmy-ansible/main/templates/nginx.conf -# Replace the {{ vars }} -# The default lemmy_port is 8536 -# The default lemmy_ui_port is 1235 -sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf +``` +server { + listen 80; + server_name my_domain.tld; + + location / { + proxy_pass http://localhost:LEMMY_PORT; + include proxy_params; + } +} ``` -You will also need to setup TLS, for example with [Let's Encrypt](https://letsencrypt.org/). After this you need to restart Nginx to reload the config. +You should also setup TLS, for example with [Let's Encrypt](https://letsencrypt.org/). [Here's a guide for setting up letsencrypt on Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04). ## Updating To update to the newest version, you can manually change the version in `docker-compose.yml`. Alternatively, fetch the latest version from our git repo: ```bash -wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/prod/docker-compose.yml +wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/docker-compose.yml docker-compose up -d ```