this post was submitted on 24 Jun 2023
14 points (93.8% liked)

Selfhosted

39939 readers
424 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:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I tried for several days to host lemmy 0.17.4 using the docker install instructions, but I was less than successful. The instructions seemed to be riddled with mistakes and and the docker-compose.yml file had some errors. I eventually mostly got it up and running, but I could never access the site through the nginx container. I had to add the lemmy-ui to the external network and expose 80 and 443, and then I could access the UI. But it seemed that the UI was unable to communicate with the DB. And I had to comment out all of the loggers in docker-compose.yml, because I they were giving me errors.

Anyway, I thought I would give it another shot now that 0.18 has been released and the instructions have been updated. It seems to be much better! I was able to almost get it up and running on my first try. However, there is one error. The nginx container failed to start. There is a file it is trying to mount, but the file doesn't exist. And the instructions don't seem to say anything about creating that file or where to download it.

Any help would be much appreciated!

The instructions I am following: https://join-lemmy.org/docs/administration/install_docker.html

The error:

Creating lemmy_proxy_1    ... error

ERROR: for lemmy_proxy_1  Cannot start service proxy: crun: mount `<path>/lemmy/nginx_internal.conf` to `etc/nginx/nginx.conf`: Not a directory: OCI runtime error

ERROR: for proxy  Cannot start service proxy: crun: mount `<path>/lemmy/nginx_internal.conf` to `etc/nginx/nginx.conf`: Not a directory: OCI runtime error
ERROR: Encountered errors while bringing up the project.

Edit

I ended up finding the file in the lemmy-ansible github project here: https://raw.githubusercontent.com/LemmyNet/lemmy-ansible/main/templates/nginx_internal.conf

It all comes up now, and I can access it from outside the server. Though, it is http only, even though I have https set to true in docker-compose.yml. And when I try to do the admin sign up, I get the error: SyntaxError: Unexpected token 'O', "Origin is "... is not valid JSON

Edit 2

It's all working now. I'm not sure exactly what I did. I set up my https cert by modifying the nginx_internal.conf and adding ssl details, and now it all works. 🀷

Thanks for the replies!

top 10 comments
sorted by: hot top controversial new old
[–] Wizard@lemmy.dustybeer.com 5 points 1 year ago (2 children)

Try Lemmy-Easy-Deploy

https://github.com/ubergeek77/Lemmy-Easy-Deploy

It worked great for getting my instance up and going. You can set the version you want as well if you prefer 17.4 over 18

[–] Dandroid@lemmy.world 1 points 1 year ago

Thanks for the reply! This seems like a great option. I am going to look more closely at this over the weekend. I want to make sure I understand what it is doing before I run it and potentially mess up some other configuration I have on my server (have done this in the recent past.......)

[–] wwwwhatever@feddit.nl -1 points 1 year ago (1 children)

Yeah, until that project dies and you have no idea how to update ever.

[–] midas@ymmel.nl 1 points 1 year ago

Eh that's a bridge people will cross then.

[–] x3i@lemmy.x3i.tech 1 points 1 year ago

I assume there is a inside the compose file that you have to replace with an actual path?

[–] Smash@lemmy.self-hosted.site 1 points 1 year ago (1 children)

well, you didn't create and populate the nginx.conf in the same directory where docker-compose.yaml is located?

[–] Dandroid@lemmy.world 3 points 1 year ago* (last edited 1 year ago)

The instructions didn't tell me I needed to. I don't know how someone is supposed to know that. I would have expected the instructions to at very least tell me I needed to make that and what the file name should be. But I did eventually figure it out. I had to search their github page to find the example one, then modify it for https

[–] Veraticus@lib.lgbt 1 points 1 year ago

Yeah the instructions are terrible.

If you’d like to host on fly.io, I wrote some scripts to try to make it easier:

https://github.com/Veraticus/fly-lemmy

[–] tkohhh@waveform.social 0 points 1 year ago* (last edited 1 year ago) (1 children)

Do you mind sharing what exactly you changed in order to get it to work? I got nginx_internal.conf installed, but did not make any changes to it. I'm not able to get the UI using http://:1236

I'm not a complete newb when it comes to nginx, but I'm having a hard time understanding what all the different parts are here. For instance, what is the lemmy-ui container for? Is that what needs to be exposed for me to access the UI? If so, I don't see any port mapping the in container definition, so is it hard-coded to use a specific port?

Any help you can provide is greatly appreciated!

[–] tkohhh@waveform.social 1 points 1 year ago

I got it going... the main problem was that the ports for the proxy container were defined in a confusing way. Rather, the port definition should be symmetrical (e.g. 1236:1236) and not conflated with the lemmy server port (8536). Then, the nginx_internal.conf should be set to listen on 1236 only.

load more comments
view more: next β€Ί