46

I'm not exactly a linux beginner but I'm far from an expert and I could use some pointers. I have a domain and a VPS through Namecheap, I chose Ubuntu 20.04 LAMP and I've tried several guides to get this working but something always goes wrong sooner or later.

My latest attempt is to follow along with this guide: https://join-lemmy.org/docs/administration/install_docker.html

No errors until the docker-compose up -d command, then

ERROR: yaml.constructor.ConstructorError: while constructing a mapping in "./docker-compose.yml", line 26, column 12 found unhashable key in "./docker-compose.yml", line 26, column 13

which leads to image: {{ lemmy_docker_image }}

I guess I could start over with a different guide but I'm just chasing my tail at this point. Could any kind soul suggest where to go from here?

top 33 comments
sorted by: hot top controversial new old
[-] infinitegoose@chiral.stream 19 points 1 year ago

Did you swap out the {{ lemmy_docker_image }} for an actual image name? e.g. dessalines/lemmy:latest

[-] IchNichtenLichten@lemmy.world 3 points 1 year ago

Nope, but I have now, see above, thanks!

[-] exu@feditown.com 5 points 1 year ago

Can you edit the post title to say [Solved] or something so others know there's a solution here?

[-] Eddie@lemmy.lucitt.social 6 points 1 year ago

If you're looking to set up a server quickly and easily, check out Lemmy Easy Deploy by ubergeek77. Just change the host name to your domain name in the config file and you're good to go.

If you're trying to access your home server from the internet, I recommend a cloudflare tunnel. Let me know if you need assistance! My dms are open

[-] spez_@lemmy.world 1 points 1 year ago

Is it possible to get this inside of Portainer?

[-] Eddie@lemmy.lucitt.social 1 points 1 year ago

Yes, since Easy Deploy deploys using the docker container, lemmy will show up as a stack in portainer, just with limited editability

[-] Orban@lemmy.world 1 points 1 year ago

I kept getting an error about lemmy ui has been moved. But I could make it with ./deploy.sh -w 0.18 -f

[-] oatmilkmaid@possumpat.io 4 points 1 year ago
[-] IchNichtenLichten@lemmy.world 2 points 1 year ago

I did, and got further than with the other guides but I couldn't get the Lemmy page to load and the log was complaining about certificate issues.

[-] eroc1990@lemmy.parastor.net 2 points 1 year ago

If you're running a separate reverse proxy that handles HTTPS requests, and don't mind the app communicating with your reverse proxy on port 80, you can turn off Caddy TLS. That's what ultimately made everything work for me, and how I'm posting from my own instance now.

[-] Kururin@talk.kururin.tech 4 points 1 year ago* (last edited 1 year ago)

Lemmy-Easy-Deploy going to hold your hand all the way. Great tool, great creator!

[-] manitcor@lemmy.intai.tech 4 points 1 year ago* (last edited 1 year ago)

I found the install to be cake using the ansible playbook https://github.com/LemmyNet/lemmy-ansible

i see those instructions already use some of the assets from the ansible deploy.

[-] IchNichtenLichten@lemmy.world 2 points 1 year ago

I looked at that one and got confused about how Ansible works. Am I to run those install commands locally or on the VPS? Thanks!

[-] manitcor@lemmy.intai.tech 1 points 1 year ago* (last edited 1 year ago)

ansible is an automation tool, it does all the things you would do manually, ssh, run commands, etc etc. The files provided bascially have it generate scripts that get pushed to the host and run. it can be run on a remote host or run on the machine you want to install on. either works.

[-] IchNichtenLichten@lemmy.world 2 points 1 year ago

I'm going to start over, I remember I had a few issues with PATH when installing Ansible on a different Mac. I think I can figure them out now.

[-] techie@techy.news 2 points 1 year ago

Came here to say the Ansible method is much, much easier than manual with Docker and from scratch.

I was banging my head for hours fixing all kinds of errors. I finally gave up and went the Ansible method and was able to get to the Lemmy login page within 5 minutes.

OP, if you decide to go the Ansible method, you’ll need to setup a separate server and install Ansible on it. From there clone the Git repo and modify the files the instructions tell you to. Make sure the two servers can talk to each other via SSH. Lastly, run the “ansible-playbook -i inventory/hosts lemmy.yml” command and your Lemmy instance should be online within a few minutes.

Honestly, my advice is to setup two temp VPS’s with Ubuntu on them. Don’t lock them down too tight and play with the Ansible deployment. Once you get a feel for how everything goes, you can redeploy the VPS’s and set them up properly with proper security.

[-] manitcor@lemmy.intai.tech 2 points 1 year ago

there are also instructions to spin up ansible within a container on the host so you don't have to install anything else on the target and use only 1 machine. I havent tried it though.

[-] brad@toad.work 3 points 1 year ago

Here are the Lemmy and Lemmy-UI sections of my docker compose

I would imagine you could simply paste your domain and ports into those and get up and running. I can also provide the entire docker compose file with my secret stuff removed if you think that would be helpful

[-] Orban@lemmy.world 2 points 1 year ago

I'd love that

[-] alaphic@lemmy.world 3 points 1 year ago

Dude, I've been having the exact same problem for the last few days and have been banging my head against the wall with it too. Thanks for posting this, I'm eagerly awaiting the responses you get

[-] IchNichtenLichten@lemmy.world 3 points 1 year ago

I hope we can both get this done :)

[-] slashzero@hakbox.social 2 points 1 year ago* (last edited 1 year ago)

I recommend using the docker images directly. As you see, the ansible scripts are basically another abstraction layer used to build the docker containers and their configs (and has string substitutions like {{some_string}} which are not valid for docker-compose.yml). Some will disagree but I feel ansible adds unnecessary complexity to deploying lemmy containers.

Anyway, glad you figured it all out!

[-] chiisana@lemmy.chiisana.net 2 points 1 year ago

I whipped this one together a while back when I was deploying my instance: https://lemmy.chiisana.net/post/264

It assumes that you’ve got a Traefik gateway setup on a separate network already, which should be just one docker compose away. Hope this helps point in the right direction!

[-] SeaMauFive@lemm.ee 2 points 1 year ago

I skimmed the guide you sent and the top says that the portions in brackets are placeholders and need to be replaced with real values. If you change {{ lemmy_docker_image }} to be the name of the image to use dessalines/lemmy:0.18.0 for example, do you get further

[-] IchNichtenLichten@lemmy.world 2 points 1 year ago

I didn't do that because I'm apparently a moron :)

I'm trying with

dessalines/lemmy:0.18.0 dessalines/lemmy-ui:0.18.0

In this section

  # actual and only port facing any connection from outside
  # Note, change the left number if port 1236 is already in use on your system
  # You could use port 80 if you won't use a reverse proxy
  - "80:8536"

this fails with Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

I tried 8080 instead and got no errors but I wasn't able to load the Lemmy page.

I can now get the "Apache2 Ubuntu Default Page - It works!" So that's something.

[-] jack@arpa.dev 2 points 1 year ago

In your post you said you installed Ubuntu with a LAMP stack. Do you plan on using Apache as the reverse proxy for your instance?

[-] infinitegoose@chiral.stream 1 points 1 year ago

When you switched ports to 8080 did you add it onto the url? e.g. http://localhost:8080

[-] jbernardini@boulder.ly 2 points 1 year ago* (last edited 1 year ago)

I found the ansible instructions from that same guide pretty easy if you wanna give those a try. feel free to DM me if you get stuck. Here's an install support chat too: https://app.element.io/#/room/#lemmy-support-new-instance:discuss.online

[-] solidarity@suguha.net 2 points 1 year ago* (last edited 1 year ago)

Could you post your docker compose file please? Remove any sensitive info of course!

Edit: As seen on the doc page you linked to: The images will likely be: dessalines/lemmy:VERSION and dessalines/lemmy-ui:VERSION

lemmy:latest

lemmy-ui:latest

[-] solidarity@suguha.net 3 points 1 year ago

Oh I see your issue, you need to replace anything in curly braces with actual values. I'm away from my pc right now but I'll give you the correct image name shortly....

[-] slashzero@hakbox.social 0 points 1 year ago* (last edited 1 year ago)

Hi there! This sounds like you might just have a typo in your docker-compose.yml file. It might be helpful if you posted your docker-compose.yml contents here (be sure to remove any sensitive information).

Line 26 of my docker-compose.yml file is the volume block/map for letsencrypt. Did you perhaps mix tabs and spaces, or have one too many spaces in your indentations, in your yaml file? That's a no-no...

Personally, I setup my instance using the same guide as you, opting for the docker containers. There were definitely a few pitfalls to deal with.

[-] IchNichtenLichten@lemmy.world 2 points 1 year ago* (last edited 1 year ago)

Here you go! There shouldn't be any sensitive info in there, I haven't modified it. The command in the instructions:

wget https://raw.githubusercontent.com/LemmyNet/lemmy-ansible/main/templates/docker-compose.yml

obtained the file and there's no instruction to modify it prior to running docker-compose up -d which is where it fails.

Edit: Lemmy screws up the formatting. It looks fine pasted into to text area but is messed up when I post. See the above link, that's what I'm using.

[-] slashzero@hakbox.social 1 points 1 year ago* (last edited 1 year ago)

Sorry I didn’t get a chance to look at this, but I’m mostly on mobile and the link doesn’t work.

For future reference you can put it in a code block and lemmy-ui should be able to render it for you.

Example code block

load more comments
view more: next ›
this post was submitted on 06 Jul 2023
46 points (88.3% liked)

Selfhosted

40576 readers
297 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 2 years ago
MODERATORS