Host Appwrite Backend with DigitalOcean Droplet

Poong Ka Vui
2 min readMay 27, 2020

--

Why you still need to pay for BaaS service like Firebase? We have Appwrite! Appwrite is a new open-source, end-to-end, back end server for front-end and mobile developers that allows you to build apps much faster. Its goal is to abstract and simplify common development tasks behind REST APIs and tools, helping developers build advanced apps faster.

Appwrite

To host Appwrite you only need as little as 1 CPU core and 2GB of RAM, and an operating system that supports Docker.

With DigitalOcean Marketplace, you can simply deploy an Linux Server with Docker preinstalled without hassle. You can follow the configuration of your DigitalOcean Droplet as picture below.

Droplets with Docker Preinstalled

Logging in as Root

After your server done setup, first log into your server, you will need to know your server’s public IP address. You will also need the password or, if you installed an SSH key for authentication, the private key for the root user’s account. Login to your server using Command Prompt(Windows) or Terminal(macOS or Linux) with command below.

$ ssh root@your_server_public_ip

About Root

The root user is the administrative user in a Linux environment that has very broad privileges. Because of the heightened privileges of the root account, you are discouraged from using it on a regular basis. This is because part of the power inherent with the root account is the ability to make very destructive changes, even by accident.

Creating a New User

We’re prepared to add the new user account that we will use to log in from now on.

This example creates a new user called norahs, but you should replace it with a username that you like:

# adduser norahs

As root, run this command to add your new user to the sudo group (substitute the highlighted word with your new user):

# usermod -aG sudo norahs

This is a good practical use case where we don’t do daily task with our root account, also for security purpose.
Then copy public key manually follow this link.
Now open a new tab in Command Prompt or Terminal to login your regular user, in our case norahs.

$ ssh norahs@your_server_ip

Install Appwrite in your server

U can install Appwrite with command below.

docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/install/appwrite:rw \
-e version=0.6.1 \
appwrite/install

When the installation complete, u can use your browser access to your Public IP of your server.

--

--