#30DaysofAppwrite : Installation

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 walkthro…



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



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

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



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

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 ?


Print Share Comment Cite Upload Translate
APA
Damodar Lohani | Sciencx (2024-03-29T08:19:02+00:00) » #30DaysofAppwrite : Installation. Retrieved from https://www.scien.cx/2021/05/02/30daysofappwrite-installation/.
MLA
" » #30DaysofAppwrite : Installation." Damodar Lohani | Sciencx - Sunday May 2, 2021, https://www.scien.cx/2021/05/02/30daysofappwrite-installation/
HARVARD
Damodar Lohani | Sciencx Sunday May 2, 2021 » #30DaysofAppwrite : Installation., viewed 2024-03-29T08:19:02+00:00,<https://www.scien.cx/2021/05/02/30daysofappwrite-installation/>
VANCOUVER
Damodar Lohani | Sciencx - » #30DaysofAppwrite : Installation. [Internet]. [Accessed 2024-03-29T08:19:02+00:00]. Available from: https://www.scien.cx/2021/05/02/30daysofappwrite-installation/
CHICAGO
" » #30DaysofAppwrite : Installation." Damodar Lohani | Sciencx - Accessed 2024-03-29T08:19:02+00:00. https://www.scien.cx/2021/05/02/30daysofappwrite-installation/
IEEE
" » #30DaysofAppwrite : Installation." Damodar Lohani | Sciencx [Online]. Available: https://www.scien.cx/2021/05/02/30daysofappwrite-installation/. [Accessed: 2024-03-29T08:19:02+00:00]
rf:citation
» #30DaysofAppwrite : Installation | Damodar Lohani | Sciencx | https://www.scien.cx/2021/05/02/30daysofappwrite-installation/ | 2024-03-29T08:19:02+00:00
https://github.com/addpipe/simple-recorderjs-demo