DEV Community

Cover image for Supabase Alternative: Self-hosted
PandaDEV
PandaDEV

Posted on

Supabase Alternative: Self-hosted

Not just another database

Appwrite is one of the best ways to self-host a database, with the whole suite of tools and an SDK for every language.

Appwrite has one of the cleanest UIs you can think of, very similar to Supabase.

Why use it over cloud based databases

I think by self-hosting, you can have full control over your data. Also, the single and most important thing, it's completely free, and you don't have to pay a subscription to host it. The only trade-off is that you need a server, but even then it does not have to be a big one because Appwrite is so lightweight.

How to install on Ubuntu Server

To install Appwrite you need docker installed.

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
Enter fullscreen mode Exit fullscreen mode
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Enter fullscreen mode Exit fullscreen mode

After this you have two options, either a normal docker container or manually with docker compose

Docker container

docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:1.5.5
Enter fullscreen mode Exit fullscreen mode

Docker compose

# create a new directory for storing the docker compose file
mkdir appwrite

# download the tow files docker-compose.yml and .env
curl -O https://appwrite.io/install/env
curl -O https://appwrite.io/install/compose

# finally start appwrite
docker compose up -d --remove-orphans
Enter fullscreen mode Exit fullscreen mode
# to restart use
docker compose stop
docker compose up -d --remove-orphans
Enter fullscreen mode Exit fullscreen mode

Conclusion

It's very useful if you make small side projects that need auth and a database in one and don't want to use old school SQL with MySQL. Now it's up to you what you do with it.

https://appwrite.io/docs

Top comments (6)

Collapse
 
snorchy profile image
Irian

Can't you self host Supabase too though? supabase.com/docs/guides/self-hosting

Collapse
 
pandadev_ profile image
PandaDEV

Yes but its a mess and most important it has a hard coded port.

Collapse
 
peiche profile image
Paul • Edited

I know this is a bit off-topic, but Appwrite Cloud has very generous free-tier limits with no trial period expiration.

Collapse
 
giannifed profile image
Gianni Feduzi
Collapse
 
pandadev_ profile image
PandaDEV

Also, a good self-hosted database with the full functionality.

Collapse
 
hemoni_granger_c4742eeb59 profile image
Hemoni Granger

It's amazing! Your article is very good and very useful to us! Thank you so much for taking the time to share with us! Have a good time with uno online with friends free.