mcmxci,

I was able to get it running with the docker compose CA app and minimal changes to the official docker-compose file (docs). I’m running swag in front of the lemmy proxy with no issues with federation. Ibracorp’s tutorial can help with the compose plugin

You’ll need to make sure the volume locations and ports are appropriate for your unraid install. You’ll also have to update your domain in the compose file. I’m running swag so I needed to make a new reverse proxy configuration per the official docs.

My compose file is below:


<span style="color:#323232;">version: "3.7"
</span><span style="color:#323232;">
</span><span style="color:#323232;">x-logging: &default-logging
</span><span style="color:#323232;">  driver: "json-file"
</span><span style="color:#323232;">  options:
</span><span style="color:#323232;">    max-size: "50m"
</span><span style="color:#323232;">    max-file: 4
</span><span style="color:#323232;">
</span><span style="color:#323232;">networks:
</span><span style="color:#323232;">  # communication to web and clients
</span><span style="color:#323232;">  lemmyexternalproxy:
</span><span style="color:#323232;">    name: proxynet
</span><span style="color:#323232;">    external: true
</span><span style="color:#323232;">  # communication between lemmy services
</span><span style="color:#323232;">  lemmyinternal:
</span><span style="color:#323232;">    driver: bridge
</span><span style="color:#323232;">    internal: true
</span><span style="color:#323232;">
</span><span style="color:#323232;">services:
</span><span style="color:#323232;">  proxy:
</span><span style="color:#323232;">    image: nginx:1-alpine
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmyinternal
</span><span style="color:#323232;">      - lemmyexternalproxy
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      # actual and only port facing any connection from outside
</span><span style="color:#323232;">      # Note, change the left number if port 1236 is already in use on your system
</span><span style="color:#323232;">      # You could use port 80 if you won't use a reverse proxy
</span><span style="color:#323232;">      - "8536:8536"
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      #- nginx.conf:/etc/nginx/nginx.conf:ro,Z
</span><span style="color:#323232;">      - /mnt/user/appdata/lemmy-nginx/nginx.conf:/etc/nginx/nginx.conf:ro
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    depends_on:
</span><span style="color:#323232;">      - pictrs
</span><span style="color:#323232;">      - lemmy-ui
</span><span style="color:#323232;">    logging: *default-logging
</span><span style="color:#323232;">
</span><span style="color:#323232;">  lemmy:
</span><span style="color:#323232;">    image: dessalines/lemmy:0.18.0
</span><span style="color:#323232;">    #image: dessalines/lemmy:dev
</span><span style="color:#323232;">    # use this to build your local lemmy server image for development
</span><span style="color:#323232;">    # run docker compose up --build
</span><span style="color:#323232;">    # build:
</span><span style="color:#323232;">    #  context: ../
</span><span style="color:#323232;">    #  dockerfile: docker/Dockerfile
</span><span style="color:#323232;">      # args:
</span><span style="color:#323232;">      #   RUST_RELEASE_MODE: release
</span><span style="color:#323232;">    # this hostname is used in nginx reverse proxy and also for lemmy ui to connect to the backend, do not change
</span><span style="color:#323232;">    hostname: lemmy
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmyinternal
</span><span style="color:#323232;">      - lemmyexternalproxy
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
</span><span style="color:#323232;">      - RUST_BACKTRACE=full
</span><span style="color:#323232;">      - LEMMY_CORS_ORIGIN=<domain>
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /mnt/user/appdata/lemmy/lemmy.hjson:/config/config.hjson
</span><span style="color:#323232;">    depends_on:
</span><span style="color:#323232;">      - postgres
</span><span style="color:#323232;">      - pictrs
</span><span style="color:#323232;">    logging: *default-logging
</span><span style="color:#323232;">
</span><span style="color:#323232;">  lemmy-ui:
</span><span style="color:#323232;">    #image: dessalines/lemmy-ui:latest
</span><span style="color:#323232;">    image: dessalines/lemmy-ui:0.18.0
</span><span style="color:#323232;">    # use this to build your local lemmy ui image for development
</span><span style="color:#323232;">    # run docker compose up --build
</span><span style="color:#323232;">    # assuming lemmy-ui is cloned besides lemmy directory
</span><span style="color:#323232;">    # build:
</span><span style="color:#323232;">    #   context: ../../lemmy-ui
</span><span style="color:#323232;">    #   dockerfile: dev.dockerfile
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmyinternal
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      # this needs to match the hostname defined in the lemmy service
</span><span style="color:#323232;">      - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
</span><span style="color:#323232;">      # set the outside hostname here
</span><span style="color:#323232;">      #- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
</span><span style="color:#323232;">      - LEMMY_UI_LEMMY_EXTERNAL_HOST=<domain>
</span><span style="color:#323232;">      - LEMMY_HTTPS=false
</span><span style="color:#323232;">      - LEMMY_UI_DEBUG=true
</span><span style="color:#323232;">    depends_on:
</span><span style="color:#323232;">      - lemmy
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    logging: *default-logging
</span><span style="color:#323232;">    init: true
</span><span style="color:#323232;">
</span><span style="color:#323232;">  pictrs:
</span><span style="color:#323232;">    image: asonix/pictrs:0.4.0-rc.7
</span><span style="color:#323232;">    # this needs to match the pictrs url in lemmy.hjson
</span><span style="color:#323232;">    hostname: pictrs
</span><span style="color:#323232;">    # we can set options to pictrs like this, here we set max. image size and forced format for conversion
</span><span style="color:#323232;">    # entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmyinternal
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - PICTRS_OPENTELEMETRY_URL=http://otel:4137
</span><span style="color:#323232;">      - PICTRS__API_KEY=API_KEY
</span><span style="color:#323232;">      - RUST_LOG=debug
</span><span style="color:#323232;">      - RUST_BACKTRACE=full
</span><span style="color:#323232;">      - PICTRS__MEDIA__VIDEO_CODEC=vp9
</span><span style="color:#323232;">      - PICTRS__MEDIA__GIF__MAX_WIDTH=256
</span><span style="color:#323232;">      - PICTRS__MEDIA__GIF__MAX_HEIGHT=256
</span><span style="color:#323232;">      - PICTRS__MEDIA__GIF__MAX_AREA=65536
</span><span style="color:#323232;">      - PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400
</span><span style="color:#323232;">    user: 991:991
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /mnt/user/appdata/lemmy-pictrs:/mnt
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    logging: *default-logging
</span><span style="color:#323232;">
</span><span style="color:#323232;">  postgres:
</span><span style="color:#323232;">    image: postgres:15-alpine
</span><span style="color:#323232;">    # this needs to match the database host in lemmy.hson
</span><span style="color:#323232;">    # Tune your settings via
</span><span style="color:#323232;">    # https://pgtune.leopard.in.ua/#/
</span><span style="color:#323232;">    # You can use this technique to add them here
</span><span style="color:#323232;">    # https://stackoverflow.com/a/30850095/1655478
</span><span style="color:#323232;">    hostname: postgres
</span><span style="color:#323232;">    command:
</span><span style="color:#323232;">      [
</span><span style="color:#323232;">        "postgres",
</span><span style="color:#323232;">        "-c",
</span><span style="color:#323232;">        "session_preload_libraries=auto_explain",
</span><span style="color:#323232;">        "-c",
</span><span style="color:#323232;">        "auto_explain.log_min_duration=5ms",
</span><span style="color:#323232;">        "-c",
</span><span style="color:#323232;">        "auto_explain.log_analyze=true",
</span><span style="color:#323232;">        "-c",
</span><span style="color:#323232;">        "track_activity_query_size=1048576",
</span><span style="color:#323232;">      ]
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmyinternal
</span><span style="color:#323232;">      # adding the external facing network to allow direct db access for devs
</span><span style="color:#323232;">      - lemmyexternalproxy
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      # use a different port so it doesnt conflict with potential postgres db running on the host
</span><span style="color:#323232;">      - "5433:5432"
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - POSTGRES_USER=<strong-user>
</span><span style="color:#323232;">      - POSTGRES_PASSWORD=<strong-password>
</span><span style="color:#323232;">      - POSTGRES_DB=lemmy
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /mnt/user/appdata/lemmy-postgres:/var/lib/postgresql/data
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    logging: *default-logging
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span>
fat_flying_pigs,

Any chance you can post your config, internal nginx conf, postgresql.conf, and the swag conf? I’m trying to do the same thing and I’ve been running into various errors. And I’ve yet to find a good unraid guide for lemmy. Would appreciate!

mcmxci,

Added internal nginx and external proxy configs to a reply. I didn’t make any changes to the postgres config.

Hope it helps

mcmxci,

My nginx.conf for lemmy-nginx is below, sorry if it’s a bit messy. I prefer to comment than remove working config. You’ll have to change

worker_processes 1; events { worker_connections 1024; } http { of kbin fix

We construct a string consistent of the “request method” and “http accept header"


<span style="color:#323232;"># and then apply soem ~simply regexp matches to that combination to decide on the
</span><span style="color:#323232;"># HTTP upstream we should proxy the request to.
</span><span style="color:#323232;">#
</span><span style="color:#323232;"># Example strings:
</span><span style="color:#323232;">#
</span><span style="color:#323232;">#   "GET:application/activity+json"
</span><span style="color:#323232;">#   "GET:text/html"
</span><span style="color:#323232;">#   "POST:application/activity+json"
</span><span style="color:#323232;">#
</span><span style="color:#323232;"># You can see some basic match tests in this regex101 matching this configuration
</span><span style="color:#323232;"># https://regex101.com/r/vwMJNc/1
</span><span style="color:#323232;">#
</span><span style="color:#323232;"># Learn more about nginx maps here http://nginx.org/en/docs/http/ngx_http_map_module.html
</span><span style="color:#323232;">map "$request_method:$http_accept" $proxpass {
</span><span style="color:#323232;">    # If no explicit matches exists below, send traffic to lemmy-ui
</span><span style="color:#323232;">    default "http://lemmy-ui";
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # GET/HEAD requests that accepts ActivityPub or Linked Data JSON should go to lemmy.
</span><span style="color:#323232;">    #
</span><span style="color:#323232;">    # These requests are used by Mastodon and other fediverse instances to look up profile information,
</span><span style="color:#323232;">    # discover site information and so on.
</span><span style="color:#323232;">    "~^(?:GET|HEAD):.*?application/(?:activity|ld)+json" "http://lemmy";
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # All non-GET/HEAD requests should go to lemmy
</span><span style="color:#323232;">    #
</span><span style="color:#323232;">    # Rather than calling out POST, PUT, DELETE, PATCH, CONNECT and all the verbs manually
</span><span style="color:#323232;">    # we simply negate the GET|HEAD pattern from above and accept all possibly $http_accept values
</span><span style="color:#323232;">    "~^(?!(GET|HEAD)).*:" "http://lemmy";
</span><span style="color:#323232;">}
</span>

end of kbin fix


<span style="color:#323232;">upstream lemmy {
</span><span style="color:#323232;">    # this needs to map to the lemmy (server) docker service hostname
</span><span style="color:#323232;">    server "lemmy:8536";
</span><span style="color:#323232;">}
</span><span style="color:#323232;">upstream lemmy-ui {
</span><span style="color:#323232;">    # this needs to map to the lemmy-ui docker service hostname
</span><span style="color:#323232;">    server "lemmy-ui:1234";
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">server {
</span><span style="color:#323232;">    # this is the port inside docker, not the public one yet
</span><span style="color:#323232;">    listen 1236;
</span><span style="color:#323232;">    listen 8536;
</span><span style="color:#323232;">    # change if needed, this is facing the public web
</span><span style="color:#323232;">    #server_name localhost;
</span><span style="color:#323232;">server_name ;
</span><span style="color:#323232;">    server_tokens off;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    gzip on;
</span><span style="color:#323232;">    gzip_types text/css application/javascript image/svg+xml;
</span><span style="color:#323232;">    gzip_vary on;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Upload limit, relevant for pictrs
</span><span style="color:#323232;">    client_max_body_size 100M;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    add_header X-Frame-Options SAMEORIGIN;
</span><span style="color:#323232;">    add_header X-Content-Type-Options nosniff;
</span><span style="color:#323232;">    add_header X-XSS-Protection "1; mode=block";
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # frontend general requests
</span><span style="color:#323232;">    location / {
</span><span style="color:#323232;">        # distinguish between ui requests and backend
</span><span style="color:#323232;">        # don't change lemmy-ui or lemmy here, they refer to the upstream definitions on top
</span>

set $proxpass “lemmy-ui”;

if ($http_accept = “application/activity+json”) {

set $proxpass “lemmy”;

}

if ($http_accept = “application/ld+json; profile="[www.w3.org/ns/activitystreams](https://www.w3.org/ns/activitystreams%5C)””) {

set $proxpass “lemmy”;

}

if ($request_method = POST) {

set $proxpass “lemmy”;

}


<span style="color:#323232;">        proxy_pass $proxpass;
</span><span style="color:#323232;">
</span><span style="color:#323232;">        rewrite ^(.+)/+$ $1 permanent;
</span><span style="color:#323232;">        # Send actual client IP upstream
</span><span style="color:#323232;">        proxy_set_header X-Real-IP $remote_addr;
</span><span style="color:#323232;">        proxy_set_header Host $host;
</span><span style="color:#323232;">        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # backend
</span><span style="color:#323232;">    location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) {
</span><span style="color:#323232;">        proxy_pass "http://lemmy";
</span><span style="color:#323232;">        # proxy common stuff
</span><span style="color:#323232;">        proxy_http_version 1.1;
</span><span style="color:#323232;">        proxy_set_header Upgrade $http_upgrade;
</span><span style="color:#323232;">        proxy_set_header Connection "upgrade";
</span><span style="color:#323232;">
</span><span style="color:#323232;">        # Send actual client IP upstream
</span><span style="color:#323232;">        proxy_set_header X-Real-IP $remote_addr;
</span><span style="color:#323232;">        proxy_set_header Host $host;
</span><span style="color:#323232;">        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">}
</span>

} /var/log/nginx/error.log debug;

mcmxci,

This is the nginx.conf file for my external proxy:


<span style="color:#323232;">server {
</span><span style="color:#323232;">    listen 443 ssl http2;
</span><span style="color:#323232;">    listen [::]:443 ssl http2;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    server_name ;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    include /config/nginx/ssl.conf;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    location / {
</span><span style="color:#323232;">        include /config/nginx/proxy.conf;
</span><span style="color:#323232;">        include /config/nginx/resolver.conf;
</span><span style="color:#323232;">#        set $upstream_app lemmy;
</span><span style="color:#323232;">        set $upstream_app proxy;
</span><span style="color:#323232;">        set $upstream_port 8536;
</span><span style="color:#323232;">        set $upstream_proto http;
</span><span style="color:#323232;">        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
</span><span style="color:#323232;">#        proxy_http_version 1.1;
</span><span style="color:#323232;">        proxy_set_header Upgrade $http_upgrade;
</span><span style="color:#323232;">        proxy_set_header Connection "upgrade";
</span><span style="color:#323232;">        proxy_set_header X-Real-IP $remote_addr;
</span><span style="color:#323232;">#        proxy_set_header Host $host;
</span><span style="color:#323232;">        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
</span><span style="color:#323232;">        client_max_body_size 50M;            
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">access_log /var/log/nginx/access.log combined;
</span><span style="color:#323232;">
</span><span style="color:#323232;">You’ll need to change  to the appropriate value. I’m forwarding requests to the proxy container referenced by the compose file
</span>
IMongoose,

I made a Ubuntu VM and followed the instructions on github.com/ubergeek77/Lemmy-Easy-Deploy, and it looks like it worked but I’m having issues getting a secure connection. I should have the correct ports open on the server and firewall so I’m not sure, I’m kind of a potato.

p5f20w18k,
@p5f20w18k@lemmy.world avatar

Did you get anywhere with this?

IMongoose,

Yes. Lemmy-Easy-Deploy works great. My issue was I did not have the domain set up properly to redirect from www.domain.com to domain.com, so the initial setup didn’t work. My email doesn’t work but email is hard.

linearchaos,
@linearchaos@lemmy.world avatar

I installed a stable diffusion docker last week, it wasn't too bad, but it also didn't need a lot of config.

I just tried installing lemmybb from the github in it, the container starts, but none of the config is even close it's just not a good candidate without someone checking it out to their own github and applying all the configs and setup.

Someone is going to need to pick it up and give it some love before it's reasonable to add it to unraid.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • TheResearchGuardian
  • Ask_kbincafe
  • KbinCafe
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines