smhk

Trying out Coolify

TL;DR: I attempt installing Coolify on Raspberry Pi OS, but it fails because my OS turns out to be 32-bit, and Coolify requires 64-bit. In future, I would use an OS such as Ubuntu Server instead of Raspberry Pi OS.

I like the idea of self-hosting, but since 2018 I’ve been using Netlify. Some features of Netlify I find useful are:

  • Upon commit to main the website is automatically re-built and published.
  • Upon build failure the website remains at the previous working build.
  • Branches (with Merge Requests) automatically deploy build previews.

You cannot self-host Netlify, but you can self-host Coolify, which looks like it has the same key features.

In these notes, I plan to try out using Coolify to replace Netlify by self-hosting this website.

Setup §

Hardware §

For the physical server I will use a Raspberry Pi 5 (8GB). I’m fortunate that there’s a brick-and-mortar Raspberry Pi store nearby, so I can just pop in and pick one up.

I bought the full pack which includes a case, USB-C Power Supply, an HDMI to micro-HDMI cable, a 32GB SD card with Raspberry Pi OS. Notably, the case has a fan to actively cool the Raspberry Pi, which is not a feature any of my previous Rapsberry Pis have had.

OS §

I’ve not used Raspberry Pi OS before. Since it comes on the SD card, I’ll give it a try.

A very easy on boarding experience. Assembled the Raspberry Pi, which is essentially a matter of plugging in the fan, putting the Raspberry Pi inside the case and then plugging it in. Put the SD card in the slot and turn it on.

The OS then prompts for a username and password, and a few other questions, and you’re all set up at the desktop. Anecdotally it was pretty nippy, though I didn’t try too much beyond web browsing. It used the full 4K resolution of my monitor, and video playback seemed smooth.

Installing Coolify §

Coolify claim to support Raspberry Pi:

You can deploy your resources to any server, including your own servers, VPS, Raspberry Pi, EC2, DigitalOcean, Linode, Hetzner, and more. All you need is an SSH connection.

Let’s try and install Coolify:

$ curl -fsSL https://cdn.coollabs.io/coolify/install.sh > install-coolify.sh
$ ls
Bookshelf  Desktop  Documents  Downloads  install-coolify.sh  Music  Pictures  Public  Templates  Videos
$ chmod +x install-coolify.sh 
$ sudo ./install-coolify.sh 
-------------
Welcome to Coolify v4 beta installer!
This script will install everything for you.
(Source code: https://github.com/coollabsio/coolify/blob/main/scripts/install.sh)

-------------
OS: raspbian 12
Coolify version: 4.0.0-beta.239
-------------
Installing required packages...
###############################################################################
WARNING: Could not detect if OpenSSH server is installed and running - this does not mean that it is not installed, just that we could not detect it.
Please make sure it is set, otherwise Coolify cannot connect to the host system. 

###############################################################################
###############################################################################
WARNING: PermitRootLogin is not enabled in /etc/ssh/sshd_config.
It is set to N/A (commented out or not found at all). Should be prohibit-password, yes or without-password.

Please make sure it is set, otherwise Coolify cannot connect to the host system. 

(Currently we only support root user to login via SSH, this will be changed in the future.)
###############################################################################
Docker is not installed. Installing Docker.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24599  100 24599    0     0   100k      0 --:--:-- --:--:-- --:--:--  100k
# Executing docker install script, commit: e5543d473431b782227f8908005543bb4389b8de
+ sh -c apt-get update -qq >/dev/null
W: http://raspbian.raspberrypi.com/raspbian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c install -m 0755 -d /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
+ sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sh -c echo "deb [arch=armhf signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/raspbian bookworm stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
W: http://raspbian.raspberrypi.com/raspbian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
INFO: Searching repository for VERSION '24.0.7'
INFO: apt-cache madison docker-ce | grep '24.0.7' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
INFO: apt-cache madison docker-ce-cli | grep '24.0.7' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce=5:24.0.7-1~raspbian.12~bookworm docker-ce-cli=5:24.0.7-1~raspbian.12~bookworm containerd.io docker-compose-plugin docker-ce-rootless-extras=5:24.0.7-1~raspbian.12~bookworm docker-buildx-plugin >/dev/null
+ start_docker
+ [ ! -z ]
+ [ -d /run/systemd/system ]
+ sh -c systemctl start docker
+ sh -c docker version
Client: Docker Engine - Community
Version:           24.0.7
API version:       1.43
Go version:        go1.20.10
Git commit:        afdd53b
Built:             Thu Oct 26 09:08:26 2023
OS/Arch:           linux/arm
Context:           default

Server: Docker Engine - Community
Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:26 2023
  OS/Arch:          linux/arm
  Experimental:     false
containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

================================================================================

To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:

    dockerd-rootless-setuptool.sh install

Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.


To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/

WARNING: Access to the remote API on a privileged Docker daemon is equivalent
         to root access on the host. Refer to the 'Docker daemon attack surface'
         documentation for details: https://docs.docker.com/go/attack-surface/

================================================================================

Docker installed successfully.
-------------
Check Docker Configuration...
Docker configuration updated, restart docker daemon...
-------------
Downloading required files from CDN...
0dcb1f80532f7561448337ab5f0c91a773817f79a90620bfc6c49b183644ec9f
latest: Pulling from coollabsio/coolify-helper
docker: no matching manifest for linux/arm/v8 in the manifest list entries.
See 'docker run --help'.

Uh oh! 💥

Looks like the script failed.

Someone else has reported the same error, and it looks like the issue is because Coolify does not support 32-bit.

Am I running 32-bit or 64-bit? §

It looks like I have 64-bit architecture, but the OS is 32-bit:

$ uname -m
aarch64
$ getconf LONG_BIT
32

Can we switch from 32-bit to 64-bit? §

Is it possible to switch without a complete re-install of the OS?

Some suggest modifying /boot/firmware/config.txt1 to set arm_64bit=1. This option is documented on the Raspberry Pi website.

Let’s give that a try:

$ sudo nano /boot/firmware/config.txt
# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Additional overlays and parameters are documented
# /boot/firmware/overlays/README

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Automatically load initramfs files, if found
auto_initramfs=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# Disable compensation for displays with overscan
disable_overscan=1

# Run as fast as firmware / board allows
arm_boost=1

# Run 64-bit
arm_64bit=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

After a reboot, this doesn’t appear to have made a difference:

$ uname -m
aarch64
$ getconf LONG_BIT
32

Conclusion §

Well, that was fun to try, but I’d feel more comfortable both using a more mainstream OS and going with 64-bit from the start.

If I try again, instead of Raspberry Pi OS, I’ll go with Ubuntu Server 23.04. 64-bit, of course.


  1. The linked blog actually mentions /boot/config.txt, but that has moved to /boot/firmware/config.txt↩︎