2020-02-06 16:26:11 +00:00
# Docker Installation
2020-03-31 00:06:31 +00:00
Make sure you have both docker and docker-compose(>=`1.24.0`) installed. On Ubuntu, just run `apt install docker-compose docker.io` . Next,
2019-12-31 14:31:34 +00:00
```bash
2020-03-31 00:06:31 +00:00
# create a folder for the lemmy files. the location doesnt matter, you can put this anywhere you want
mkdir /lemmy
cd /lemmy
2020-06-23 13:37:16 +00:00
2020-03-31 00:06:31 +00:00
# download default config files
2020-07-14 17:30:36 +00:00
wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/prod/docker-compose.yml
wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/lemmy.hjson
wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/iframely.config.local.js
2020-06-23 13:37:16 +00:00
# Set correct permissions for pictrs folder
mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs
2019-12-31 14:31:34 +00:00
```
2020-09-24 13:47:24 +00:00
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
```
2020-10-04 13:42:30 +00:00
If you'd like a different database password, you should also change it in the `docker-compose.yml` **before** your first run.
2020-11-29 12:09:14 +00:00
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:
2020-05-15 14:21:37 +00:00
`docker-compose up -d`
2019-12-31 14:31:34 +00:00
2020-10-04 13:42:30 +00:00
You can access the lemmy-ui at `http://localhost:1235`
2020-07-14 17:30:36 +00:00
To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config ](https://raw.githubusercontent.com/LemmyNet/lemmy/main/ansible/templates/nginx.conf ), could be setup with:
2019-12-31 14:31:34 +00:00
```bash
2020-07-14 17:30:36 +00:00
wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/ansible/templates/nginx.conf
2019-12-31 14:31:34 +00:00
# Replace the {{ vars }}
2020-10-04 13:42:30 +00:00
# The default lemmy_port is 8536
# The default lemmy_ui_port is 1235
2019-12-31 14:31:34 +00:00
sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf
```
2020-03-31 00:06:31 +00:00
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.
2020-02-06 16:26:11 +00:00
## Updating
2019-12-31 14:31:34 +00:00
2020-03-31 00:06:31 +00:00
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:
2019-12-31 14:31:34 +00:00
```bash
2020-07-14 17:30:36 +00:00
wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/prod/docker-compose.yml
2019-12-31 14:31:34 +00:00
docker-compose up -d
```