▲
A
A
▼
安装Host Your Own Reddit Alternative with Lemmy in Docker
What is Lemmy?
Lemmy is an open-source, federated link aggregator similar to Reddit and built with Rust.
Log into the host device
Run the following commands in terminal
# install docker and docker-compose
sudo apt install docker docker-compose docker.io
# create a working directory
sudo mkdir lemmy && cd lemmy/
# download the container files
sudo wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/prod/docker-compose.yml
sudo wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/lemmy.hjson
sudo wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/iframely.config.local.js
# create pictrs directory
sudo mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs
# edit docker-compose.yml
sudo nano docker-compose.yml
Scroll down to the POSTGRES_PASSWORD line and enter a secure password
Press CTRL+O, Enter, CTRL+X to write the changes to docker-compose.yml
Continue with the following command
sudo nano lemmy.hjson
Press CTRL + W and search for database
Scroll down to the database password and update the value to match the value set in docker-compose.yml earlier
Press CTRL+O, Enter, CTRL+X to write the changes to lemmy.hjson
Run the following command to start the Lemmy Docker container
sudo docker-compose up -d
Open a web browser and navigate to http://DNSorIP:1235
Log into Lemmy with the username and password lemmy