DEV Community

loading...
Cover image for #30DaysofAppwrite : Installation
Appwrite

#30DaysofAppwrite : Installation

lohanidamodar profile image Damodar Lohani ・Updated on ・4 min read

Intro

Appwrite is an open-source, self-hosted Backend-as-a-Service that makes app development easier with a suite of SDKs and APIs to accelerate app development. #30DaysOfAppwrite is a month long event focused on giving developers a walkthrough of all of Appwrite's features, starting from the basics to more advanced features like cloud functions! Alongside we will also be building a fully featured Medium Clone to demonstrate how these concepts can be applied when building a real world app. We also have some exciting prizes for developers who follow along with us!

Installing Appwrite

Let's kick off Day 2 of #30DaysofAppwrite by discussing the first step of your Appwrite journey: Installing Appwrite. We'll cover the different ways to install Appwrite, as well as some tips to debug common issues you may face during the installation.
Appwrite uses Docker to install and run its services, so we can install Appwrite on any system that supports Docker, including MacOS, Linux and Windows. To develop locally on our machine, we need to first install Docker. If you have not already installed Docker, please visit the Docker official installation docs.

Installing Appwrite on any platform is as simple as running a single command in the terminal/command prompt. We just need to choose the right command for our platform. Below are the installation commands for different platforms.
Make sure you use the latest appwrite version from here

Linux, MacOS and any Unix Compatible Machine

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:0.7.2
Enter fullscreen mode Exit fullscreen mode

Windows

If you are on command prompt use

docker run -it --rm ^
    --volume //var/run/docker.sock:/var/run/docker.sock ^
    --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
    --entrypoint="install" ^
    appwrite/appwrite:0.7.2
Enter fullscreen mode Exit fullscreen mode

If you are on powershell use

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:0.7.2
Enter fullscreen mode Exit fullscreen mode

Possible Errors

If you run into issues during installation, here are some common problems to investigate. First make sure you have enough disk space and RAM to run Appwrite. Appwrite requires at least 1 CPU core and 512MB (2GB Recommended) of RAM. If ClamAV is installed, 2GB of RAM is required since ClamAV uses at least 1GB on its own. If your system doesn't have enough memory or CPU power, your installation may terminate without any information or error message.

Do note that ClamAV can be disabled if you are running low on resources. You can follow this guide to learn how.

Another common error that might occur during installation is caused by the Docker Hub pull rate limits. The installation script needs to pull the appwrite/appwrite Docker image from Docker Hub, so if you are not signed in to Docker Hub, you might run into this error. To resolve this error, you just need to login to Docker Hub using docker login command. For more information visit the official Docker docs.

Upgrading Appwrite

If you already have an Appwrite server running and want to upgrade to new version, the Appwrite migration tool is there to help. In order to upgrade Appwrite, make sure you are on the same folder you ran your Appwrite installation script previously. This folder should contain a folder appwrite inside which there should be your docker-compose.yml and .env files. Run the installation for the next version from the folder containing the appwrite folder. Once you successfully install the new version, then you can run the migration tool. Make sure to backup your data, your docker-compose.yml file and .env file and settings before running the migration.
You can run the migration tool using the following command from the folder containing your docker-compose.yml file.

docker-compose exec appwrite migrate
Enter fullscreen mode Exit fullscreen mode

More information on upgrading and migration can be found in the official docs.

Installing Appwrite on Cloud Providers

Installing Appwrite on cloud providers is not much different than installing locally. We can deploy Linux virtual machines on any cloud providers and then follow the UNIX installation code to install Appwrite.

Checking the Health of Your Appwrite Installation

Once you have successfully installed Appwrite, you can check the health and status of your Appwrite server. In order to run initial checks, you can use Appwrite's doctor command, executed via docker-compose exec appwrite doctor. This command should be run from the directory you installed Appwrite in, where your docker-compose.yml file exists.

Running this command will show you the details of your Appwrite Server and status of various services.

Appwrite Doctor

Checking the logs

If you look at the docker-compose.yml file, you can see the list of various different services. Whenever you have an issue, you can look into the logs of each service or the logs of whole stack. Still from the same directory containing your docker-compose.yml file, you can run the following commands to view the logs.

  • docker-compose logs : To view the logs of all the services together
  • docker-compose logs <name_of_the_service>: To view the logs of the individual service.

Credits

We hope you liked this write up. You can follow #30DaysOfAppwrite on Social Media to keep up with all of our posts. The complete event timeline can be found here

Feel free to reach out to us on Discord if you would like to learn more about Appwrite, Aliens or Unicorns πŸ¦„. Stay tuned for tomorrow's article! Until then πŸ‘‹

Discussion (6)

Collapse
2shrestha22 profile image
Sangam Kumar Shrestha

I am currently using Firebase and I want to know how it can be better than Firebase in terms of price and performance.
A cloud instance with 2GB (or 1GB without CalmAV) of RAM cost $10 (or $5) a month. So my question is how many request or users Appwrite can handle with this setup? I need a rough estimation about how much I need to spend.

Collapse
eldadfux profile image
Eldad A. Fux

It depends a lot on your specific use-case and specific app load, but the self-hosted setup has the potential to cost a lot less $$ The Appwrite team will soon release a series of public benchmarks to demonstrate how far can a basic setup go :)

Collapse
2shrestha22 profile image
Collapse
karanja_b4ha profile image
Baha_dev

Awesome postπŸ’―

Collapse
alexweininger profile image
Alex Weininger

Really well written post Damodar. This will be super helpful to so many people including me. πŸŽ‰πŸš€

Collapse
lohanidamodar profile image
Forem Open with the Forem app