this post was submitted on 22 Jun 2023
87 points (98.9% liked)

Selfhosted

37829 readers
600 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 have tried installing it with docker on Ubuntu 20.04 and 22.04 LTS but cannot seem to get it working. The build keeps erroring out with docker errors.

top 46 comments
sorted by: hot top controversial new old
[–] [email protected] 15 points 1 year ago (1 children)
[–] [email protected] 1 points 1 year ago

I definitely agree on Easy Deploy. Worked right away for my instance.

[–] [email protected] 14 points 1 year ago (1 children)

If your using docker I recommend getting a docker-compose file that does 98% of the config work for you. Pretty sure there's one in the install docs.

[–] TCGM 5 points 1 year ago (1 children)

I've been having trouble understanding how the docker-compose thing works, and the whole... impermanence of docker containers. Got any tutorials you'd recommend? Note I'm on Windows.

[–] [email protected] 3 points 1 year ago (1 children)

Are you planning to host it on a Windows machine?

If you don't have experience with docker, don't jump straight to docker compose. Start simpler.

If you want to have data persist after a container is killed, have a look at the -v option of "docker run". It allows you to mount a volume.

[–] TCGM 2 points 1 year ago

Yes, I'd be hosting it through Docker Desktop on my Windows server.

Most programs I'd want to host, including Lemmy, pretty much only seem to work through docker-compose.

[–] [email protected] 10 points 1 year ago

What are the errors?

[–] yay 6 points 1 year ago (1 children)

I got mine running via Docker by copying the docker-compose, nginx, and lemmy.hjson files from the lemmy-ansible repo. Everything is working so far except votes and comments from other instances. They won't sync for some reason.

[–] [email protected] 1 points 1 year ago (1 children)

Here is mine https://gist.github.com/jeena/6179470a8d616455f30635a5c71f5f64 which had a similar problem with the comments, although I couldn't post comments on my own instance either.

For me the thing was that I had to add:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

and

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;

And also change the nginx in the docker to port 8080 so my normal nginx could keep running on 80 and handle all the ssl certificate stuff.

My setup is:

Browser -> native Nginx -> docker Nginx -> lemmy

[–] yay 1 points 1 year ago

Thanks! My set up is a bit different however. I don't use docker nginx and I just use the native one but I do have proxy_set_header Upgrade $http_upgrade; and proxy_set_header Connection $connection_upgrade; on my nginx.conf.

I could post comments locally on my own instance. That works but I can't see comments or upvotes from other instances but I can see their posts (not all of it though). Likewise, I can see my own instance's posts from another instance but not the comments or upvotes.

My instance is also behind Cloudflare but turning off the proxy doesn't change the behaviour.

[–] [email protected] 5 points 1 year ago

I was able to get it running from source on Gentoo (without docker). Building from source is an option but you need to manage the dependencies and daemons yourself. This is my first comment! Good luck with your setup

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago)

I've been having issues with 0.17.4. I saw people suggesting a non-docker, build from git method but really wanted docker to work.

I'm now using 0.18.0-rc.4. Built without issue using the dockerhub image and has been stable for 24hrs

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago)

Not specific to Lemmy but ubuntu's weird snap version of docker has given me random issues in the past, perhaps that could be the issue. Installing docker by following the official instructions means you are guaranteed to get a fully functional install and that's one variable you wouldn't have to worry about at least.

Edit: Forgot to mention but I'm running it on docker myself, I just followed the official documentation and whatnot. Using a debian 11 based LXC on Proxmox.

[–] [email protected] 5 points 1 year ago (1 children)

I'm using Proxmox and Docker-Compose. My instance is on an alpine LXC.

Very happy with it.

[–] [email protected] 1 points 1 year ago (1 children)

Would it be possible to teach us? Or give a quick step-by-step guide to make in run at least?

[–] [email protected] 1 points 1 year ago (1 children)

Well, if it's your first time selfhosting and setting up your environment, I'd to things in steps. Great thing about virtualization is that you can snapshot.

Once you get proxmox up and running, choose an OS to virtualize, snapshot once made. Snapshot once configuration for users etc, snapshot once docker has been installed, snapshot after docker-compose has been configured.. You get the idea.

Set up backup of the VMs/containers, set up lemmy using the official docker-compose step-by-step guide. Once you reach it on port 80, set up nginx.

[–] [email protected] 1 points 1 year ago

Since messing around with Linux more than 10 years ago, I always had the idea of self hosting something myself on a headless PC.

Until last year, I had the bad habit (for today's standards) to host everything on a single machine. My Linux server was my SMB file server, mail server, torrent daemon, minecraft server, firewall, and so on.

Last year, thanks to what I learnt with vmware at work, I decided to install proxmox at home, bought a couple of old PCs so that I could have a 3-nodes Proxmox cluster, and a separate machine for proxmox backup server.

Everything that was running on a single OS before, now has its own VM (for shit like Windows) or LXC (for most of the stuff).

You can say I'm a bit of an old school user now, so maybe you can understand me if I think that running lemmy, inside a docker compose for lemmy, inside its own container, inside proxmox, sounds like a weird recipe for a lot of overhead.

It seems all the cool stuff on github now always have the instructions that start with "step 1: install docker" which, honestly in a virtualized environment, I'm not sure we still need it.

Anyway, back to your post, I tried to follow both the "docker" and the "from scratch" documentation but they're clearly lacking some steps because I failed miserably every time I tried.

[–] [email protected] 4 points 1 year ago (2 children)

I had some luck with the prebuilt images from dessalines' dockerhub and using the compose file in the repo with logging commented out.

It was stable for about a week before I tried to update and broke my database and federation completely. I might try again when 0.18 stable drops.

[–] [email protected] 1 points 1 year ago

always make a database backup before performing upgrade.

[–] [email protected] 1 points 1 year ago

another docker user here. Why does our thumbnails look the same :) I know there is something wrong with my setup. I made a post here https://leddit.minnal.icu/post/1045 but still no idea.

[–] [email protected] 3 points 1 year ago

The docker compose stack is pretty straightforward, i just use the images dessalines/lemmy:0.17.4 and dessalines/lemmy-ui:0.17.4 instead of trying to build them

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

Post your docker-compose file and error message here so people can actually provide advises for your setup.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

The Ansible method is easy and worked fine for me on 22.04: https://github.com/LemmyNet/lemmy-ansible

Just remember to setup ssh without a password using this command from your local machine:

ssh-copy-id yourserver.com

[–] [email protected] 2 points 1 year ago

I'm a fan of just straight up Debian, so I went the https://github.com/LemmyNet/lemmy-ansible route on my VPS with Debian 11 stable.

[–] [email protected] 2 points 1 year ago

Ansible worked really well for me

[–] aggelalex 2 points 1 year ago

You are using two technologies that have a bad of working like shit, together; Ubuntu/snap and docker. You can try podman if you want, or a different distro. Or, at least, install the official docker way.

[–] [email protected] 2 points 1 year ago
[–] corne 2 points 1 year ago (2 children)

Will self-hosting Lenny have the limitation that you’ll be missing a lot of comments when subscribing to magazines from other instances? I am considering it tough

[–] [email protected] 2 points 1 year ago (1 children)

Comments federate to instances with subscribed users for that community. The first time a user subscribes to the community federation will start and future comments will begin to show up on the instance. Can’t see old comments… on smaller/self instances that problem will be more visible.

[–] corne 1 points 1 year ago

On my soapbox (mastodon) instance I have made this modification so that I can open posts on its original instance. This might be good to have in Lemmy too then.

[–] [email protected] 1 points 1 year ago

No but I feel finding new communities is more difficult

[–] [email protected] 2 points 1 year ago

Using the ansible playbook i was up and running in 20 min on a do droplet

[–] Declared0978 2 points 1 year ago* (last edited 1 year ago)

Been trying for like 2 weeks - Lemmy Easy Deploy, a couple different guides through google, couple different youtube vids, the official docs. In and out of docker, always with a fresh VM (Debian and Ubuntu)... It always installs without errors, but never get it to load the page in a browser. Not sure what's wrong, maybe just cursed.

[–] styx 1 points 1 year ago

I tried with the official docker way, and failed too many times :) . Then I decided to lurk around some public instances and let the platform mature for a little bit more. The problem is usually the docker build fails.

[–] [email protected] 1 points 1 year ago

Same, I tried on a fresh Ubuntu, a fresh Debian, with Docker, from scratch, using the package manager's Rust, using the official Rust script, etc. (I really wanted to run an instance...)

It fails somewhere everytime.

The documentation is lacking, and/or I'm more ignorant about this than I thought.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

I spawned up a LXC in my Proxmox for it as soon as the Reddit fiasco began. Originally tried the Docker way, failed... My Docker is installed the official way by the way. Tried the "install from scratch" way, also failed... Finally gave the source a casual read and decided to compile it from source.

The pict-rs bit is a hassle. It has taken me some time to get all the dependencies right and compile Imagemagick version 7 for Ubuntu 22.04 from source. But it worked eventually.

I then installed the rust toolchain and checked out the latest stable release tag at the time aka 0.17.3 and compiled lemmy. Nothing went astray and I followed the remaining steps in the "install from scratch" doc to complete the setup. P.S. Oh right you need to make the lemmy PostgreSQL user SUPERUSER otherwise the database migration script would not work. A commit was already made to make it unnecessary. It will make its way to 0.18.0 release I guess.

I initially encountered some issues in federation. Subscriptions stuck at pending for remote instances, regardless of their size and traffic. I tried many ways and still it did not work. I have thought of axing the container and restarting from the beginning.

While I was weighing my options, I found an advice in an issue at lemmy GitHub repo that suggested the problem was leftover from previous hostname changes and dumping the existing database and recreating from sketch would help. I have indeed altered the hostname once or twice during setup. So I followed the advice and federation is working now.

So far not a butter smooth experience but not the worst either. It does take some troubleshooting capacity and patience. But heck selfhosting has been like that since time immemorial.

[–] [email protected] 1 points 1 year ago

I used Ansible to do it, which really just automated a docker install. Oddly, I actually had issues doing docker myself, so maybe I was missing something that it needed.

[–] [email protected] 1 points 1 year ago (1 children)

I've been trying for more than a week. LemmyEasyDeploy worked. But now i'm stuck with ssl certificate.

[–] [email protected] 1 points 1 year ago (1 children)

Lemmy Easy Deploy handles the SSL certificates for you. You don't need to buy them

[–] [email protected] 0 points 1 year ago (1 children)

I get ssl errors when i try to access the site.

[–] [email protected] 1 points 1 year ago (1 children)

Maybe start from scratch? Maybe you could ask the developer. I bought SSL tickets but ended up not needing them

[–] [email protected] 0 points 1 year ago

I've started from scratch several times. Never get further than the build command. :) But i will try again later today.

[–] marsta 1 points 1 year ago (1 children)

If you post your configs and errors we might be able to help you. I set up a vm with docker compose and proxy it through traefik instead of nginx

[–] bobafett 1 points 1 year ago

I was using the docker-compose file from the official instructions.

[–] apearson 1 points 1 year ago

Tip: Don't use :dev use :0.17.4

[–] [email protected] 1 points 1 year ago

I tried the official setup guide but I never actually got it to work. So many weird problems with ports and intra-Docker networking.

The only version of Lemmy I was able to get working, very easily, was through YunoHost.

Unfortunately, the latest Lemmy version YunoHost supports is 0.16.7. I really hope someone who truly understands setting up these services can help maintain the Lemmy_ynh app, as YunoHost is a great tool for people to self-host with.

load more comments
view more: next ›