this post was submitted on 22 Jun 2023
42 points (100.0% liked)

Selfhosted

39948 readers
513 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'm interested in running Lemmy on an ARM64 host, mostly just for fun and because it's possible.

I've tried a couple of things without getting it right yet:

Building from scratch on Ubuntu 20.04 This went quite well but I was unable to get pict-rs working, so there was no image hosting. I followed this guide: https://join-lemmy.org/docs/administration/from_scratch.html I had to build imagemagick to get the ARM64 binary, however pict-rs did not run. Is it correct that it's included with the lemmy-server binary or am I understanding how it works wrong?

Using Docker images I was able to get Lemmy up and running using 0.17.3 ARM64 docker images (unfortunately 0.17.4 images don't exist yet). I set up an nginx reverse proxy on the host and was able to access the instance OK, however there was no connectivity between my instance and external sites. Looking in the logs I saw timeout errors:

lemmy_1     | LemmyError { message: None, inner: Request error: error sending request for url (https://kbin.social/u/Emptiness): operation timed out
lemmy_1     | 
lemmy_1     | Caused by:
lemmy_1     |     0: error sending request for url (https://kbin.social/u/Emptiness): operation timed out

So I was wondering if anybody had a guide out there to hosting Lemmy (preferably 0.17.4) on an ARM64 host, either by building it from scratch or by using Docker images. Or any other method really.

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

That second error is not a matter of your ARM64 architecture, but a networking thing. If you launch a bash shell in your container, does any network activity work? That will tell you if it’s the container, or just Lemmy.

[–] HorseFD 1 points 1 year ago (2 children)

I thought of trying that, but the lemmy container doesn't have ping/wget/curl, unless there is a way to test this without those tools.

[–] RuckusTraveler 2 points 1 year ago (1 children)

You should be able to use docker exec to get a bash prompt from within the docker container and manually install ping using apt/apk.

[–] HorseFD 1 points 1 year ago

I should, I think I gave up on this approach too quickly. The lemmy user isn't a superuser, and I couldn't su to root. I'm sure there's another way to log in as the root user though. I'll give this a try.

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

After getting into the shell, just install the tools you need using the apk command, e.g. apk --no-cache add curl

[–] BitOneZero 4 points 1 year ago (1 children)

ARM64 docker images (unfortunately 0.17.4 images don’t exist yet).

I would use the "Lemmy from Scratch", and go with using github checkout for lemmy_server code.

I'm running my instance on ARM64 on Oracle Cloud, they are giving out free ARM systems with 24GB of RAM and 200GB storage.

[–] HorseFD 2 points 1 year ago (1 children)

That does sound incredibly good for free.

Did you have any issues with pict-rs? Is it indeed included within the lemmy-server binary?

[–] BitOneZero 3 points 1 year ago* (last edited 1 year ago) (2 children)

That does sound incredibly good for free.

It's a little too good to be true, they have been known to shut down people without notice... I wouldn't rely on it. And the screens to use it are kind of tricky, but there are lots of instruction videos, blogs and Reddit postings about it.

Did you have any issues with pict-rs? Is it indeed included within the lemmy-server binary?

I skipped that for now. I don't think ARM64 matters, Linux is Linux. I skipped it as I didn't want to take on policing images people upload, but as Lemmy improves I might change my mind.

I see no reason ARM64 should matter for Lemmy vs. x86, this is run of the mill stuff like PostgreSQL, Rust, NodeJS.

[–] ndr 2 points 1 year ago (1 children)

Damn, I checked out their website and it’s really tempting. I might try it a for a small hobby project that I won’t rely on long-term. Thanks for sharing!

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

The other catch is they only have so much capacity for free tier. I tried for a while to get one, but never had any luck.

[–] HorseFD 2 points 1 year ago (1 children)

I've just started a new instance on Oracle Cloud given how good the free tier is.

I'm maxed out on everything free: 4 CPU cores, 24 GB RAM, 200 GB storage.

Do you have any idea what the implications are of changing the block volume performance up from the default balanced to higher performance or UHP? All I can find on pricing is here: https://www.oracle.com/cloud/storage/pricing/

But it doesn't mention anything about free tier eligibility.

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

No idea, I did find some Lemmy discussions on Oracle Cloud: https://lemmy.world/post/55124

[–] HorseFD 1 points 1 year ago

I'm gonna jack it up to the highest performance and see if it eats into my first month's free credit.

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

I built my own arm64 v0.17.4 docker image. It's available on docker hub:

mpatton/lemmy:0.17.4-linux-arm

mpatton/lemmy-ui:0.17.4-linux-arm

What are you using as your reverse proxy?

[–] HorseFD 1 points 1 year ago

I ended up using your images and it's working great. Currently playing around with 0.18.0-rc.5

[–] HorseFD 1 points 1 year ago

Thanks, I'll check that out if my from-scratch attempt fails. I'm using nginx as a reverse proxy.

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

My script should get you running 0.17.4 on ARM64:

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

It will take a while to compile, since no Docker images are available, but otherwise it should work.

It does the reverse proxy and HTTPS setup for you, no need for Nginx. If the reverse proxy is your problem, maybe this will help?

I don't have a lot of testers for ARM64, but I have heard of success, so hopefully it will work for you. And if you have any bugs, I'd be happy to fix them for the benefit of everyone :)

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

I'll have a look at this and let you know how I go. Does this work on different distros? E.g. Ubuntu/Debian, Centos, etc? The official Ansible script is Ubuntu only (possibly other apt-based distros).

[–] HorseFD 1 points 1 year ago* (last edited 1 year ago) (1 children)

I've just given the script a go and it seems to have failed

=> => transferring context: 23.07MB                                                                                                                                                                                                                                                                                   0.2s
 => [lemmy lemmy 2/6] RUN apt-get update  && apt-get -y install --no-install-recommends postgresql-client libc6 libssl1.1 ca-certificates  && rm -rf /var/lib/apt/lists/*                                                                                                                                             18.7s
 => [lemmy builder 2/7] RUN apt-get update  && apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev git  && rm -rf /var/lib/apt/lists/*                                                                                                                                                         14.7s
 => [lemmy lemmy 3/6] RUN addgroup --gid 1000 lemmy                                                                                                                                                                                                                                                                    0.5s
 => [lemmy lemmy 4/6] RUN useradd --no-create-home --shell /bin/sh --uid 1000 --gid 1000 lemmy                                                                                                                                                                                                                         0.4s
 => [lemmy builder 3/7] WORKDIR /app                                                                                                                                                                                                                                                                                   0.0s
 => [lemmy builder 4/7] COPY ./ ./                                                                                                                                                                                                                                                                                     0.2s
 => [lemmy builder 5/7] RUN echo "pub const VERSION: &str = "$(git describe --tag)";" > "crates/utils/src/version.rs"                                                                                                                                                                                                  0.2s 
 => ERROR [lemmy builder 6/7] RUN cargo build --release                                                                                                                                                                                                                                                              399.8s 

Altough the building timer is still running

[+] Building 761.3s (15/18)

Is there somewhere I can access logs to see what happened?

Edit: Managed to screenshot the error prior to it disappearing

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

Well, that's a new one. Never seen a build fail before.

I see some issues on Lemmy's tracker about builds failing due to network issues. Something about not being able to clone files it needs for the build.

Can you try the build again, and if this happens consistently, file an issue on my tracker? I'll try to reproduce the issue and fix it if possible.

[–] HorseFD 1 points 1 year ago

I tried again on a new server, and I'm still getting the same error. It may be related to this:

https://github.com/LemmyNet/lemmy/issues/3235

I see the same references to email_verified_body and email_verified_subject

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

The easiest would probably be waiting for official ARM containers for 0.17.4. You could also build the containers yourself, the dockerfile should be somewhere in the Lemmy repositories.

Also, nothing's stopping you from building Lemmy from scratch and having Postgres and pictrs in container. Just make sure to forward the necessary ports.

No idea what the error is unfortunately. Are you sure you set all ENV and config variables correctly?

[–] HorseFD 1 points 1 year ago

I might try building from scratch again and running pict-rs in a docker container.

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

I had to work out all of the issues myself to get it working on my RaspberryPi 4. For this error, did you add a network to your "lemmy" container that would allow it access to the internet?

https://github.com/LemmyNet/lemmy/issues/3167#issuecomment-1595846910

I'm still using 0.17.3, btw. I haven't checked if 0.17.4 for arm64 is out yet.

Edit: Just checked and it looks like they're just skipping past 0.17.4 and moving on to 0.18.0 on their docker hub. https://hub.docker.com/r/dessalines/lemmy/tags

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

The docker docs are out of date. You need to expose the lemmy service to an external network. I created a third network called lemmybridge and added it to the lemmy service.

[–] HorseFD 1 points 1 year ago

This sounds promising, I'll give that a try. Thanks

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

The latest docker-compose in the repo has a fix for this.

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

I have the same errors regarding kbin.social with my instances running on x86_64, and have yet been successful in federating with them on 0.17.4. I am subscribed to 4 of their "magazines", but cannot get content to start coming in, and have similar errors:

LemmyError { message: None, inner: Request error: error sending request for url (https://kbin.social/u/Larvitar): operation timed out

lemmy.ml instances seem to get stuck on pending subscription as well. Other instances I have subscribed to have no issue. Sorry this doesn't answer your arm64 question, but just wanted to share those errors aren't limited to arm64.

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

I'm not sure this applies to me since I'm hosting on kubernetes, but thanks for sharing that link. I can communicate with any instance other than kbin, and lemmy.ml just seems spotty/inconsistent (I assume it's overloaded slightly still).

[–] HorseFD 1 points 1 year ago

In this case, it just so happened to be kbin.social in the example I posted. In my case it's every outbound connection timing out.

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

The default docker-compose.yml from the guide has the docker lemmy network set as internal. You need to make it not an Internal network.

Source: Did the same thing with the same problem, on Oracle ARM64 VPS.

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

I have it running on an arm64 machine with NixOS. If you're up for a bit of a learning curve, try it, it's worth it.

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

I made this post a couple of days ago. I'm using ARM64, hope this helps you move things along!

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

Make sure your Lemmy container has outside internet access. Check my previous post for an example.
https://lemmy.death916.xyz/post/3068

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

Following because I am interested in hosting an instance on one of my RPi’s

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

This doesn't look like an ARM64-specific issue. Could you try to docker exec into the container and curl that URL which showed the timeout error? If that fails then something is wrong with your networking setup.

load more comments
view more: next ›