In light of the ongoing Reddit blackout, many users are seeking alternative platforms to host their communities. One popular option is Lemmy, a self-hosted federated link aggregator. However, most of the available documentation on running Lemmy involves using Nginx or Caddy as a reverse proxy. If you're utilizing Traefik with docker-compose and docker labels on your server, this guide will walk you through the process of setting up a working Lemmy instance without the need for Nginx or Caddy.
Step-by-Step Guide:
Docker Compose Configuration:
To begin, create a new docker-compose.yml file and include the necessary services for running Lemmy. Here's a sample configuration to get you started:
Adjust Hostname:
Remember to replace the placeholder hostname in the configuration with the actual hostname of your server. This ensures that Lemmy is accessible via the correct URL.
Start Lemmy: Save the changes to your docker-compose.yml file and execute the following command in the terminal to start Lemmy:
docker-compose up -d
Verify Lemmy's Availability:
Once the containers are up and running, access your Lemmy instance by navigating to the URL associated with your server's hostname.
Please note that the instructions provided here assume a basic understanding of Docker, Traefik, and server administration. Adjustments may be necessary based on your specific setup and requirements.
edit: Also note that this is for version 0.17.4. In case a new version releases you need to change the tag for both lemmy and lemmy-ui
Figured I'd ask to see if you know if this method is still working? I have mine setup very nearly identically to what you have here, and I have corrected my lemmy.hjson to have the correct hostname and password for the database. The only changes I have made thus far is to remove the HTTP redirection, and to change things like me cert resolver, the Lemmy version, and other small corrections.
However, all I am getting is a gateway timeout when I try to visit the url I have setup. Do you have any idea why this might be? I'll provide my docker-compose below.
In one of the updates, I noticed in the traefik dashboard that traefik was forwarding to a different port. So I added the following label in my web labels: