]> Untitled Git - lemmy.git/blob - docs/src/administration_install_docker.md
05ec8ab30b7df0bcd121cea9e65687251424c3d0
[lemmy.git] / docs / src / administration_install_docker.md
1 # Docker Installation
2
3 Make sure you have both docker and docker-compose(>=`1.24.0`) installed. On Ubuntu, just run `apt install docker-compose docker.io`. Next, 
4
5 ```bash
6 # create a folder for the lemmy files. the location doesnt matter, you can put this anywhere you want
7 mkdir /lemmy
8 cd /lemmy
9
10 # download default config files
11 wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml
12 wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/lemmy.hjson
13 wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/iframely.config.local.js
14
15 # Set correct permissions for pictrs folder
16 mkdir -p volumes/pictrs
17 sudo chown -R 991:991 volumes/pictrs
18 ```
19
20 After this, have a look at the [config file](administration_configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname, and possibly the db password. Then run:
21
22 `docker-compose up -d`
23
24 To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](https://raw.githubusercontent.com/dessalines/lemmy/master/ansible/templates/nginx.conf), could be setup with:
25
26 ```bash
27 wget https://raw.githubusercontent.com/dessalines/lemmy/master/ansible/templates/nginx.conf
28 # Replace the {{ vars }}
29 sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf
30 ```
31
32 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.
33
34 ## Updating
35
36 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:
37
38 ```bash
39 wget https://raw.githubusercontent.com/dessalines/lemmy/master/docker/prod/docker-compose.yml
40 docker-compose up -d
41 ```