How to setup Appwrite on Ubuntu
Tags: appwrite, hacktoberfest, tutorial, opensource
Published: 2021-10-08 17:23:28

Setting up [Appwrite](https://appwrite.io/) on any Operating System, or Kernel is pretty easy. Here we are going to go through an easy and simple method to setup Appwrite on a Linux Kernel.
Well I use Ubuntu Operating System, so let's get started with setting up Appwrite on [Ubuntu](https://ubuntu.com/).

Before getting started, I would like to give a brief intro to **What is Appwrite**.

![what](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8iexw3djrd5cj2jkp4t.png)

So, Appwrite is a self-hosted solution that provides developers with a set of easy-to-use and integrate REST APIs to manage their core backend needs. Basically, it is a new open-source, end-to-end, back end server for front-end and mobile developers that allows to build apps much faster. Its main goal is to abstract and simplify common development tasks behind REST APIs and tools, helping developers build advanced apps faster.

**Requirements**
The only System Requirements to install Appwrite is- a small CPU core and 2GB of RAM, and an operating system that supports Docker.
If you have these in place, let us start then!

>Note:
If you are migrating from an older version of Appwrite, you need to follow the migration instructions, steps of which, are provided as the last part of this article. (Upgrading from Older Versions)
So feel free to jump on to the last part if you already have a version on Appwrite installed and are planning to migrate to another version.

![go-below](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bvinm71e6nemfripdhnr.png)

## How to setup Appwrite on Ubuntu

Now, there can be multiple ways to install Appwrite, but the easiest way to start running an Appwrite server is by running **Docker installer tool from the terminal**. Before running the installation command, make sure you have [Docker CLI](https://www.docker.com/products/docker-desktop) installed.

If you don't have it installed, [here's](https://docs.docker.com/engine/install/ubuntu/) how you can do it. Refer to it and you are good to go!

![docker-whale](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/btt7ozr5icknehsykjy0.png)

After that, the process is very simple-
You just need to open your terminal and run the following [bash](https://www.gnu.org/software/bash/) commands:

```sh
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.10.4
```

*You may change the Appwrite version accordingly*

I followed the same procedure and the results were like so-

![screenshot-setup-appwrite-ubuntu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jcnme3369r75zh5j1bax.png)

Basically, here we are making use of Docker, to install application on our local machine. It is simple, fast, and easy to run and use. If you are confused as to *What is Docker* then you may want to refer [here](https://dev.to/noviicee/beginner-s-guide-to-docker-42co)

Well, the entire process took me around 5 minutes, when I did everything from scratch after installing a Docker CLI. (my net was also slow then :')


**Upgrading From Older Versions**

If you are migrating from an older version of Appwrite, you need to follow these steps.

In order to upgrade your Appwrite server from an older version, you should use the Appwrite migration tool after you have installed the new version. The migration tool will adjust your Appwrite data to the new version's structure to make sure your Appwrite data is compatible with any internal changes.


The first step is to install the latest version of Appwrite.
Go to the directory where you first installed Appwrite and find the appwrite directory. Inside the directory there will be a docker-compose.yml file. Now, we need to execute the following command from the same appwrite directory:

```sh
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.10.4
```

What this command will do is pull the docker-compose.yml file for the new version of Appwrite and after that it will perform the installation.
After the command is successfully executed, and the setup is completed, we can verify that we have the latest version of Appwrite. We can make use of the following command to do so

```sh
docker ps | grep appwrite/appwrite
```

Make sure that the `STATUS` doesn't have any errors and all the appwrite/appwrite containers have the same latest version.

We can now start with the migration part.
For that, we will again have to navigate to the appwrite directory where our docker-compose.yml is present and run the following command:

```sh
cd appwrite/
docker-compose exec appwrite migrate
```

Once the migration process has completed successfully, we are all set to use the latest version of Appwrite!

You can also have a look at the official [migration instructions](https://appwrite.io/docs/upgrade) present in the [official documentation page of Appwrite](https://appwrite.io/docs)

<hr>

![all-done](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z2hzwiazj1q8ndmy9ta8.png)

***All Done!***
Now you are all set to make your first api call!

*Thanks for reading :)*
*All reviews and feedbacks are welcomed :hug:*