I am a software developer by craft and a linux system admin by hobby. I cannot commit to moderating and managing my own instance, but I would be glad to help someone with the technical aspects.

The most common complaint I saw in Reddit and here about switching to Lemmy is the difficulty of setting it up, so I thought I would help bridge this gap.

While I have never hosted my own instance before, I already checked the setup guide and it looks pretty simple to me, so I am confident I can do it. Please feel free to comment or DM.

It would be great if you can comment general questions. I can then respond to you here and maybe others will see it and know how to host their own instances too.

  • FatherZen@lemmy.one
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    An up to date step by step instruction for docker, ansible, or scratch setup would be a fantastic step in the right direction. I’m not a complete moron, but I feel the current guides are lacking. There’s a lot of assumptions on the admins knowledge of the associated systems beforehand. As someone else said, the first to make a turnkey solution… hot dog. Would absolutely blast adoption into space.

  • Les Orchard@links.decafbad.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I’ve been playing with my own single-user instance here using Docker. Mostly I just followed the Lemmy docs. It’s been nice & responsive and takes barely any resources, so far. I think this system can really benefit from a lot of small instances to spread the load.

  • arkcom@kbin.social
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Something that would help a lot of selfhoster types would be prebuild docker images and a good example docker compose. (something kbin could also use)

  • Chromozone@lemmy.chromozone.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    The thing I struggled with the most was adapting the provided docker-compose.yml for my Caddy setup.

    I am using caddy-docker-proxy, which I absolutely love but their documentation is not the greatest for matchers.

    If anyone else wants a super basic Lemmy instance running on Caddy with their domain on Cloudflare here is a docker-compose.yml

    Please make sure you update your lemmy.hjson hostname field to match the domain you used in the docker-compose.yml for the caddy labels

    If you’re not using Cloudflare you can replace build: . (and not use the Dockerfile I provided below) in the caddy service with image: lucaslorentz/caddy-docker-proxy:ci-alpine (and remove the caddy.acme_dns label) and I believe it will fall back to Let’sEncrypt

    version: "3.9"
    
    services:
      caddy:
        container_name: caddy
        build: .
        depends_on:
          - lemmy-ui
          - pictrs
        ports:
          - 80:80
          - 443:443
        environment:
          CADDY_INGRESS_NETWORKS: caddy
        networks:
          - caddy
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - /opt/docker/caddy/data:/data
          - /opt/docker/caddy/config:/config
        labels:
          caddy.log.format: console
          caddy.acme_dns: cloudflare YOUR_CLOUDFLARE_API_TOKEN
        restart: unless-stopped
      lemmy:
        container_name: lemmy
        image: dessalines/lemmy:0.17.3
        depends_on:
          - postgres
          - pictrs
        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"
        networks:
          - caddy
        volumes:
          - /opt/docker/lemmy/lemmy.hjson:/config/config.hjson:ro
        labels:
          caddy: "your.domain.com"
          caddy.@lemmy: path_regexp ^/(api|pictrs|feeds|nodeinfo|\.well-known)/.*$
          caddy.@post: method POST
          caddy.@accept: header Accept application/*
          caddy.reverse_proxy_1: "@lemmy {{upstreams 8536}}"
          caddy.reverse_proxy_2: "@post {{upstreams 8536}}"
          caddy.reverse_proxy_3: "@accept {{upstreams 8536}}"
        restart: unless-stopped
      lemmy-ui:
        container_name: lemmy-ui
        image: dessalines/lemmy-ui:0.17.3
        depends_on:
          - lemmy
        environment:
          LEMMY_UI_LEMMY_INTERNAL_HOST: lemmy:8536
          LEMMY_UI_LEMMY_EXTERNAL_HOST: localhost:1234
          LEMMY_HTTPS: true
        networks:
          - caddy
        labels:
          caddy: "your.domain.com"
          caddy.reverse_proxy: "{{upstreams 1234}}"
        restart: unless-stopped
      pictrs:
        container_name: pictrs
        image: asonix/pictrs:0.3.1
        environment:
          PICTRS__API_KEY: API_KEY
        user: 991:991
        volumes:
          - /opt/docker/pictrs:/mnt
        networks:
          - caddy
      postgres:
        container_name: postgres
        image: postgres:15-alpine
        environment:
          POSTGRES_DB: lemmy
          POSTGRES_USER: lemmy
          POSTGRES_PASSWORD: password
        volumes:
          - /opt/docker/postgres:/var/lib/postgresql/data
        networks:
          - caddy
        restart: unless-stopped
    
    networks:
      caddy:
        external: true
    

    Here is the Dockerfile used for the caddy container:

    ARG CADDY_VERSION=2.6.4
    
    FROM caddy:${CADDY_VERSION}-builder AS builder
    
    RUN xcaddy build \
        --with github.com/lucaslorentz/caddy-docker-proxy/v2@v2.8.4 \
        --with github.com/caddy-dns/cloudflare
    
    FROM caddy:${CADDY_VERSION}-alpine
    
    RUN apk add --no-cache tzdata
    
    COPY --from=builder /usr/bin/caddy /usr/bin/caddy
    
    CMD ["caddy", "docker-proxy"]
    
  • smstnitc@lemmy2.addictmud.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Being a highly technical guy, I struggled to get everything running on the server that I am hosting other things on. The biggest hurdle was letsencrypt, but other things weren’t working quite right. I ended up just paying for a new ubuntu vps so I can run the ansible playbook (I use arch linux everywhere else). That turned out to be super simple and “just worked”.

  • fuser@quex.cc
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Hi there - thanks for posting. I’m serving lemmy (ansible install) on nginx from Ubuntu 22.04 and I’m seeing this weird problem sometimes where the submit button is not enabled on the “create post” form. Sometimes it works but then it inexplicably stubbornly refuses to - I am not seeing any apparent error show up in the console, nothing in the lemmy or nginx logs (naturally, because the HTML form isn’t submitting to the server because the submit button’s disabled). Happens in different browsers, tried restarting nginx, rebooting, nothing seems to fix it. Now, my addled brain does recall seeing something about Ubuntu 22.04 having some issues with Lemmy and perhaps that’s what I’m seeing - it’s just weird and I’ve never seen a web app do this before - any ideas? The url is quex.cc and you’re welcome to test there if you like, but I’m really just looking for any suggestions for investigation before I start thinking about moving to a different OS.

      • fuser@quex.cc
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        yes, good suggestion, thank you - although before I do I’m going to spend a bit of time to see if I can isolate the problem - I just tested it from a mobile device and the local PC browser and it’s working now. I used the exact same url, text and everything to create the post and I didn’t change anything - didn’t reboot, didn’t even restart the browser. Except for the fact that it’s intermittent, it looks like some kind of js or css problem, but I need to replicate it and if I do that, I’ll probably be able to figure it out.