Ubuntu
This chapter assume you've a running Ubuntu server, and you've access to the root
account.
These instructions should work for any Debian based distro
Create Swap file
This part was taken from Appwrite DigitalOcean script.
It's vital to create a swap file when using a low-budget servers, it also will benefit the high-budget ones.
Run this commands as root
fallocate -l 2G /swapfile
ls -lh /swapfile
chmod 600 /swapfile
ls -lh /swapfile
mkswap /swapfile
swapon /swapfile
swapon --show
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Install Docker
You will install Docker using the Docker installation script. For more advance and specific installation, check Docker install instructions.
First, You need to fetch the "installation script."
curl -fsSL https://get.docker.com -o get-docker.sh
Best practice
When downloading any script from an outside source, it's always best examining the file before executing it. To see all the steps for that get-docker.sh
file you can run
sudo sh ./get-docker.sh --dry-run
This command will print all the command this script is about the run.
To install Docker run the script:
sudo sh get-docker.sh
You can choose one of two methods to install Appwrite
Install Appwrite automatically
It's best to cd
to the current user home directory, so, later it will be easy to find Appwrite Docker file.
cd ~
Install Appwrite using Appwrite's one-liner, and follow the instructions.
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.3
Install Appwrite manually
You can install Appwrite manually, and this is usually what I prefer.
To install Appwrite create a folder in the current user home directory, and cd
into it.
cd ~
mkdir appwrite
cd appwrite
Any Appwrite instance is required to have these two files.
docker-compose.yml
- This file contains all the necessary containers, volumes and networks requires to run an instance of Appwrite.env
- This file contains all environment variable information. Those variables that are being past to one or more containers and let you modify Docker containers without having the need to change the container itself.
You won't create those file line by line, rather you will download them from Appwrite permanent endpoint for these two files. To download these, run:
curl https://appwrite.io/install/compose -o docker-compose.yml
curl https://appwrite.io/install/env -o .env
Run this command 👇 to start and create your Appwrite installation.
docker compose up -d
You can go to Post installation page to finish your installation.