[go: up one dir, main page]

DEV Community

Cover image for Run Appwrite on a Raspberry Pi
Jim Bennett
Jim Bennett

Posted on • Originally published at jimbobbennett.dev on

Run Appwrite on a Raspberry Pi

TL;DR - use Raspberry Pi OS 64-bit if you want to run Appwrite on a Pi

I’ve started working on a personal project, so thought it might be fun to give Appwrite a spin. Appwrite is an open-source app backend for web and mobile projects, you can think of it as a competitor to Firebase.

Rather than use a hosted version, or try to run it on Azure and burn through my credits, I decided to run it on a local server. I have a few Raspberry Pi’s kicking round, so thought Id try running it on there.

Hardware

Appwrite claims to run on as little as 1 CPU and 2GB of RAM, so a Pi 4 with 4GB should be more than enough. I have one spare, so set it up.

Raspberry Pi OS

The first thing to note is that Appwrite does run on Arm, but only Arm64. The ‘default’ Raspberry Pi OS is the 32-bit version, and Appwrite will not run on this. Instead, when you set up your SD card, you need to use Raspberry Pi OS 64-bit. In my case I’m using the lite version as I want to run this as a headless server.

The Raspberry pi OS lite 64-bit option in the imager

I installed this on an SD card, then booted up my Pi 4.

Configuring the software

Appwrite runs as a docker container, so the first thing to do is install docker. The convenience script from docker works perfectly on the Pi:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh
Enter fullscreen mode Exit fullscreen mode

Takes a while, but this sets up docker. I then like to add the current user to the docker group to save sudoing all the things.

sudo usermod -aG docker $USER
Enter fullscreen mode Exit fullscreen mode

Now docker is installed, you can install Appwrite. Appwrite has 2 ways to do this - a quick install and a manual install. I decided to do the manual install in case I needed to configure things later.

You start by creating a folder to run from on your Pi, then downloading a docker compose and .env file:

mkdir appwrite
cd appwrite

curl -o docker-compose.yaml https://appwrite.io/install/compose
curl -o .env https://appwrite.io/install/env
Enter fullscreen mode Exit fullscreen mode

From here, you can build the container and start it up:

docker compose up -d
Enter fullscreen mode Exit fullscreen mode

This runs the container detached - as in it runs in the background, returning to the current session. If you close your shell it will stay running.

Once I had this running, I could then open Appwrite by accessing my Pi from a browser. Appwrite runs on port 80, so listens to default HTTP requests on the Pi. From there, create a new account to access the server.

The appwrite login screen

Top comments (1)

Collapse
 
hemangjoshi37a profile image
Hemang Joshi

getting this error :

hemang@raspberrypi:~/appwrite $ docker compose up 
[+] Running 0/20
 ⠿ appwrite-worker-certificates Error                                      9.6s
 ⠦ appwrite-worker-deletes Pulling                                         9.6s
 ⠦ appwrite-worker-builds Pulling                                          9.6s
 ⠦ appwrite-worker-mails Pulling                                           9.6s
 ⠿ appwrite Error                                                          9.6s
 ⠦ appwrite-worker-webhooks Pulling                                        9.6s
 ⠿ influxdb Error                                                          9.6s
 ⠦ appwrite-schedule Pulling                                               9.6s
 ⠦ appwrite-maintenance Pulling                                            9.6s
 ⠦ appwrite-realtime Pulling                                               9.6s
 ⠿ telegraf Error                                                          9.6s
 ⠦ appwrite-executor Pulling                                               9.6s
 ⠿ redis Error                                                             9.6s
 ⠦ appwrite-worker-audits Pulling                                          9.6s
 ⠿ mariadb Error                                                           9.6s
 ⠦ appwrite-worker-databases Pulling                                       9.6s
 ⠦ appwrite-usage Pulling                                                  9.6s
 ⠿ traefik Error                                                           9.6s
 ⠦ appwrite-worker-functions Pulling                                       9.6s
 ⠴ appwrite-worker-messaging Pulling                                       9.6s
no matching manifest for linux/arm/v8 in the manifest list entries
Enter fullscreen mode Exit fullscreen mode