Gegenfeld
2 min read

How to self-host Appwrite using Docker

How to self-host Appwrite using Docker

Appwrite is a free and open-source Backend-as-a-Service (BaaS), serving as an alternative to Firebase, that can be self-hosted. This guide will walk you through the steps to deploy Appwrite using Docker.

What you need

You need an up-to-date version of Docker and Docker Compose, installed on your web-server (e.g., running on Ubuntu 20.04) and a domain, pointed to your server’s IP address.

  • Docker pre-installed on your server

  • A domain name pointed to your server’s IP address

Need a server? We're partnered with UpCloud — enjoy €25 in free credits to deploy cloud servers for self-hosting and more!

Note: We'll use UpCloud as our hosting provider, but you can use any other provider as well.

Step 1: Update your server and install docker-compose

Simply copy and paste the code below into your terminal and follow the instructions. This assumes you have Docker CE preinstalled. If not, please follow our guide on how to self-host Docker first.

Update package lists, upgrade all packages, and install the Docker Compose plugin
bash
apt update && apt -y upgrade 
apt install docker-compose-plugin

Note: If you don't have Docker CE installed yet, read our Docker Self-Hosting Guide.

Step 2: Create a new Appwrite directory on your server

Create and enter a directory for the Appwrite installation by running this command:

Create an Appwrite directory and navigate into it
bash
mkdir Appwrite && cd Appwrite

Note: The command mkdir creates the new directory (named Appwrite) while cd enters it.

Step 3: Download the required Appwrite configuration files

You require two files, the docker-compose.yml file and the .env file, in order to properly run Appwrite. To download the required files, use the following command:

Download Appwrite Docker Compose file and environment file
bash
curl -o docker-compose.yml https://raw.githubusercontent.com/appwrite/appwrite/master/docker-compose.yml
curl -o .env https://raw.githubusercontent.com/appwrite/appwrite/master/.env

Note: The Client URL (short: curl) is a command-line tool for file transfer with a URL syntax.

Step 4: Open .env file to modify environment variables

Use your preferred text editor (nano shown here) to modify environment variables and their values:

Open and edit the .env environment file in Nano editor
bash
nano .env

Common environment variables you might want to modify in .env:

  • _APP_ENV: Set to ‘production’ for production environment

  • _APP_DOMAIN: Your domain name (e.g.,

    https://app.example.com

    )

  • _APP_REDIS_PASSWORD: Redis password

  • _APP_DB_ROOT_PASSWORD: Database root password

  • _APP_USAGE_STATS: Enable/disable usage statistics

Step 5: Start Appwrite with Docker Compose

In your Appwrite directory, run:

Start containers in detached mode
bash
docker compose up -d

This starts all required Appwrite services in the background. The first startup may take a few minutes because Appwrite will pull all Docker images and initialize the services.

Step 6: Open Appwrite in your browser

After the services are running, open your browser and go to the domain or IP address you configured in your .env file. For example: https://app.example.com If you didn’t set up a domain yet, you can also use your server’s IP with HTTPS. Appwrite automatically generates a self-signed SSL certificate for local testing, but for production, it’s recommended to use a proper SSL certificate (e.g., via Let’s Encrypt).

Complete the web setup

When you open the URL, Appwrite will show a setup wizard where you:

  • Create the initial admin account (email and password)

  • Confirm domain and other settings

Written by

G

Gegenfeld Team

Gegenfeld Team