Lemmy-ui, verified and packaged by Elestio
9.2K
Lemmy is a selfhosted social link aggregation and discussion platform.
Deploy a fully managed Lemmy on elest.io if you are interested in exploring a decentralized and community-oriented approach to online content.
You can deploy it easily with the following command:
git clone https://github.com/elestio-examples/lemmy.git
Copy the .env file from tests folder to the project directory
cp ./tests/.env ./.env
Edit the .env file with your own values.
Create data folders with correct permissions
mkdir -p ./pictrs
chown -R 991:991 ./pictrs
mkdir -p ./nginx.conf
chown 700 ./nginx.conf
mkdir -p ./lemmy.hjson
chown 700 ./lemmy.hjson
mkdir -p ./pgdata
chown 700 ./pgdata
Run the project with the following command
docker-compose up -d
You can access the Web UI at: http://your-domain:6580
Here are some example snippets to help you get started creating a container.
version: "3.3"
services:
proxy:
image: nginx:1-alpine
ports:
# only ports facing any connection from outside
- 172.17.0.1:6580:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro,Z
# setup your certbot and letsencrypt config
# - ./certbot:/var/www/certbot
# - ./letsencrypt:/etc/letsencrypt/live
restart: always
depends_on:
- pictrs
- lemmy-ui
lemmy:
image: elestio/lemmy:${SOFTWARE_VERSION_TAG}
hostname: lemmy
restart: always
environment:
- RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
volumes:
- ./lemmy.hjson:/config/config.hjson:Z
depends_on:
- postgres
- pictrs
lemmy-ui:
image: dessalines/lemmy-ui:${SOFTWARE_VERSION_TAG}
environment:
# this needs to match the hostname defined in the lemmy service
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
# set the outside hostname here
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
- LEMMY_HTTPS=true
depends_on:
- lemmy
restart: always
pictrs:
image: asonix/pictrs:0.3.1
# this needs to match the pictrs url in lemmy.hjson
hostname: pictrs
# we can set options to pictrs like this, here we set max. image size and forced format for conversion
# entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
environment:
- PICTRS__API_KEY=${API_KEY}
user: 991:991
volumes:
- ./pictrs:/mnt
restart: always
postgres:
image: postgres:15-alpine
# this needs to match the database host in lemmy.hson
hostname: postgres
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- ./pgdata:/var/lib/postgresql/data
restart: always
| Variable | Value (example) |
|---|---|
| SOFTWARE_VERSION_TAG | latest |
| API_KEY | api-key |
| POSTGRES_PASSWORD | password |
| POSTGRES_USER | user-name |
| POSTGRES_DB | db-name |
The Elestio Lemmy Docker image sends the container logs to stdout. To view the logs, you can use the following command:
docker-compose logs -f
To stop the stack you can use the following command:
docker-compose down
To make backup and restore operations easier, we are using folder volume mounts. You can simply stop your stack with docker-compose down, then backup all the files and subfolders in the folder near the docker-compose.yml file.
Creating a ZIP Archive For example, if you want to create a ZIP archive, navigate to the folder where you have your docker-compose.yml file and use this command:
zip -r myarchive.zip .
Restoring from ZIP Archive To restore from a ZIP archive, unzip the archive into the original folder using the following command:
unzip myarchive.zip -d /path/to/original/folder
Starting Your Stack Once your backup is complete, you can start your stack again with the following command:
docker-compose up -d
That's it! With these simple steps, you can easily backup and restore your data volumes using Docker Compose.
Content type
Image
Digest
sha256:070ad9450…
Size
163.6 MB
Last updated
almost 3 years ago
docker pull elestio/lemmy-uiPulls:
5
Sep 21 to Sep 27