[SOLVED] Help with Lemmy setup
Hello! I have been struggling through a few tutorials on getting a lemmy instance to work correctly when setup with Docker. I have it mostly done, but there are various issues each time that I do not have the knowledge to properly correct. I am familiar with Docker, and already have an Oracle VPS set up on ARM64 Ubuntu. I already have portainer and an NGINX proxy set up and working okay. I have an existing lemmy instance "running" but not quite working. My best guess here would be to have someone assist with setting up the docker-compose to work with current updates/settings, as well as the config.hjson.
TIA, and I cant wait to have my own entry into the fediverse working right!
If your VPS is purely for Lemmy, I'd suggest blowing it away and using the ansible playbook referenced here. I found the current docker-compose does not function, there are broken references to external nginx configs.
I ran into problems too. Does this posting hint at what is wrong? (The container names need to match hostnames?) https://lemmy.ml/post/1167448
Thats a different issue to what I encountered. For me the nginx docker config had a reference to the host nginx config... I had no nginx installed so "docker-compose up" failed.
Thanks for the tip. My VPS currently has several containers with services running that I use for myself and friend group. Though I DID try to ansible to a blank local VM for testing, and I couldnt really even get the Ansible installation working on my control node. I am not very well versed in Linux yet. I scrape by for most things, but much yet eludes me.
I am trying to stick it out with Docker for now. My NGINX Proxy manager seems to work fine for proxying my partially broken setup currently, and I dont think I will have any issues once I can work out the kinks in the other containers.
test
Working Setup files, for my ARM64 Ubuntu host server. The postgres, lemmy, lemmy-ui, and pictrs containers all are on the lemmyinternal network only. The nginx:1-alpine container is in both networks. docker-compose.yml
::: spoiler spoiler
:::
lemmy.hjson:
::: spoiler spoiler
:::
The following nginx.conf is for the internal proxy, which is included in the docker-compose.yml This is entirely separate from Nginx-Proxy-Manager (NPM)
nginx.conf:
::: spoiler spoiler
:::
The nginx-proxy-manager container only needs to be in the same container network as the internal nginx:1-alpine container from the stack.
You need to create a proxy host for http port 80 to the IP address of the internal nginx:1-alpine container on the lemmyexternalproxy network in docker. Include the websockets support option.
https://lemmy.bulwarkob.com/pictrs/image/55870601-fb24-4346-8a42-bb14bb90d9e8.png
Then, you can use the SSL tab to do your cert and such. NPM is free to work on other networks with other containers as well, as far as I know.
hey @Jattatak, you seem to be the only other person I can find who is facing similar troubles to myself when trying to set up a lemmy instance. I've redone my docker-compose, nginx.conf, and lemmy.hjson to be exactly the same as yours (with some changes in the password / domain name). I'm also running an nginx proxy manager container.
However, it seems I'm still having the same problem of being able to see post content but not comments in other instances. I have the added problem of when trying to post a comment on my instance, the form freezes until I refresh the page. The comment does actually get posted.
I've also made sure the 'lemmyinternal' network is not isolated. I wonder did you manage to do anything to trouble shoot this issue? are there any ports I need to open on my firewall beyond 80, 443?
Most likely it is a nginx reverse-proxy issue. I would recommend to get rid of the nginx in the docker-compose if you still have that and directly proxy the Lemmy backend and Lemmy-ui via the system Nginx in a similar fashion to the Ansible script nginx example.
But it's really hard to do "remote" setup support like this, so you will have to experiment a bit yourself.
I am not an NGINX expert by any means. The instance is reachable to the lemmy-ui via the proxy. I can "Sign up" and search for communities and such, but it seems like the backend is failing. Maybe an issues between lemmy and postgres?
More likely a websocket failure. I heard from another project that uses websockets for the frontend to communicate with the backend that Nginx proxy manager seems to have issues with websockets even if they are enabled via that toggle in the UI. But no real idea what the issue might be.
I hear issues with Nginx proxy manager all the time, but obviously it attracts a certain type of user, so it might not be the tool's fault after all.
hi, can you post your docker-compose.yaml, nginx config and screenshots/logs of failures?
(2/2) I am able to connect to my lemmy UI site and navigate. When I try to view "Communities", I get stuck with just a spinning wheel, and never get results. Same for trying to login or create an account. I have checked logs for all the containers, and so far the only error is on the lemmy_lemmy_1 container, which is the following (Error is the last entry, labelled DEBUG):
::: spoiler spoiler
:::
(1/2) Alright, thanks for helping.
docker-compose.yml
::: spoiler spoiler
:::
The NGINX I am using is not the one that came with the stack, but a separate single container for nginx-proxy-manager. I did not customize the conf that it installed with, and only used the UI to set up the proxy host and SSL, both of which are working (front end, at least.). The config seems to be unrelated on this, however I can share it if the rest of the information below is not enough.
nginx config and lemmy.hjson would be useful as well
Sure thing. lemmy.hjson:
::: spoiler spoiler
:::
I am not certain if I am somehow getting the wrong location of the config in the container. There is no volume or link for a conf file from host:container, so I am just grabbing from the default area /etc /nginx/nginx.conf:
::: spoiler spoiler
:::
it seems there is no config for lemmy nginx here.. might be in other files?
I may be mistaken in my choice of proceeding, but as many are reporting, the install guide provided docker-compose and general docker instructions dont quite seem to work as expected. I have been trying to piecemeal this together, and the Included lemmy nginx service container was completely excluded (edited out/deleted) once I had the standalone nginx-proxy-manager setup and working for regular 80,443 ->1234 proxy requests to the lemmy-ui container.
Does the lemmy nginx have a specific role or tie in? I am still fairly new to reverse proxying in general.
yeah, nginx config for lemmy is not very straighforward. you need to mimic this:
also - can you check if all containers are running? just do
docker-compose psin the lemmy dir.All containers are running. I handle them with Portainer, though I build the stack from the CLI in the lemmy dir, so Portainer cant fully manage them. Reboots and logs and networking and such work fine though.
As for the nginx config, the nginx proxy manager I use currently has all proxy-host/settings setup from the webGUI, where I use the GUI to set up the proxy host information and SSL information. I did no manual edits to any configurations or settings of the container during or after compose. Only GUI actions. When looking at the nginx.conf I replied with here (my current conf), I do not see anything related to that proxy host I created from the GUI. I am not sure if that is normal or not, or if I maybe have a wrong .conf included here.
With that in mind, would you suggest I simply overwrite and/or add your snippet to my existing conf file?
How did you setup your NGINX proxy? Can you post your NGINX config file as well as your docker-compose.yml file?
Just posted
Yea Ill do a write up in a bit with everything I can share that helped. Ill post it under the original thread. Not sure if I can sticky things but Ill try.
@[email protected]
Did you ever get this up and running? I am also using NPM on top of the nginx in the stack, and I can't seem to federate with lemmy.ml
Would love to know if you found a fix that could work for me
I got mine all squared away (I hope), if you still need assistance.
Hey, I do.
Everything is working amazing, except I can't subscribe to anything on lemmy.ml.
What did you do to fix yours?
Just posted
I couldn't tell you what the problem was, but using your configs with my parameters fixed it! Here I am posting on lemmy.ml from my own instance! Thank you very much
All I can say is you just got federated! Pay it forward or something altruistic like that.
Im actually making my little write up right now. Will post under the root thread shortly
Not yet. Based on my error logs, Im thinking some sort of websocket issue where operations are timing out trying to communicate with other instances. Unfortunately I am not well familiar with NGINX and proxies in gerenal (hence using GUI based NPM). Im hoping I can find a kind soul to basically walk with me through my setup and see if the issue can be pinpointed. Ill definitely post how it got working if/when I get there.
Awesome, thank you.
I am in the same boat, although I am quite comfortable with most tech things, NGINX is a new world for me.
I'm wondering if I should migrate my NPM to caddy or something.
Hey, does your instance have the "UI: v0.XX.X" tag at the bottom of the page? Mine does not, only the BE tag. I see other successful instances DO have it. Wondering if somehow related.
Mine does, I see UI: v0.17.3
Ive noticed mine DOES have it when viewed from another instance, however when I view it natively, I do not have it. Stuff is weird.