26
submitted 3 weeks ago* (last edited 3 weeks ago) by arrakark@10291998.xyz to c/selfhost@lemmy.ml

Hey; I just got a Lemmy instance up and running. I'd like to share some tips and things that helped me along the way.

I used the Ansible installer found here. Just following the instructions is pretty clear if you've ever set up a server before. I did have a couple of hickups though:

  • In the hosts config file, there's a like that says "myuser@example.com: replace with the destination you use to connect to your server via ssh."" There's a typo down below where there is no myuser@example.com, it actually says example.com instead. Do replace it with your username and domain.
  • The customPostgresql.conf DOES need to be tuned for your server memory and CPU; the default did not work for me
  • When it says Configure a DNS A Record to point at your server's IP address. it means you need an IPv4 address for your server. Unfortunately, this means you can't use the cheapest Vultr tier at $2.5/mo, but you have to use the $3.5/mo instance at least.
  • I used the $5/mo Vultr instance instead of $3.5 because 512MiB of RAM caused my server to run out of memory and start killing processes. For some reason nginx would be the first to go.
  • Speaking of nginx; it was not configured to start on startup for some reason. A quick sudo systemctl enable nginx fixed that.
  • To diagnose the memory issue; I had to go docker ps | grep postgres, get the hash/ID for postgres, then do sudo docker logs 5115641fc0b2 to see the logs
  • To see the server logs, the /srv/lemmy/<domain name here> is where the docker-compose.yml file is, so if you cd into this dir, only then can you run docker compose logs -f lemmy or docker compose logs -f lemmy lemmy-ui pictrs to see the lemmy logs
  • Sometimes, pressing a button in the config menu doesn't do anything. Generally, it's a backend issue and not a frontend one, but the front-end does not tell you that anything has gone wrong. If you "Inspect" and open up the console in your browser, you'll see the server request done and you can see the response.
  • I was surprised to learn that you can't make a federated AND private Lemmy instance. I guess it makes sense? I kind of want to save on server bandwidth/resourse by being the only user though...
  • My ISO of Debain did not have a swap file or partitioned any swap space. Create a swap file and make it permanent through the following commands: sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile and then edit sudo nano /etc/fstab and add the line /swapfile none swap sw 0 0. Without the swap Lemmy would crash the server.

Anyways, hope these notes help someone! If you've got any tips I'd love to hear.

top 3 comments
sorted by: hot top controversial new old
[-] NotAnArdvark@lemmy.ca 2 points 3 weeks ago

Does Lemmy life feel any different using your private instance now?

[-] arrakark@10291998.xyz 1 points 3 weeks ago

Funny enough I never used Lemmy without a private instance, so I wouldn't know!

[-] seang96@spgrn.com 1 points 3 weeks ago

The biggest thing I learned is give postgres a crap ton of ram especially if you use autosubscribe to communities bot. Nginx logs can tell you response times and timeouts, timeouts will be from slow queries and if you get a ton, need to bump up your RAM.

Use https://phiresky.github.io/lemmy-federation-state/site to troubleshoot federation issues.

this post was submitted on 01 Nov 2024
26 points (100.0% liked)

Self Hosted - Self-hosting your services.

11504 readers
2 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules

Important

Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!

Cross-posting

If you see a rule-breaker please DM the mods!

founded 3 years ago
MODERATORS