Chirag's Blog
February 28, 2025
Appwrite was built with self-hosting in mind, making running on your own hardware as easy as possible with minimal hassle. Self-hosting allows users to have complete control over their stored data and provides extensive customization capabilities, enabling users to modify and tailor the source code to perfectly align with their needs.
This blog will discuss how to self-host Appwrite on your servers from scratch and some troubleshooting tips you might need.
Coolify is an all-in-one Platform as a Service (PaaS) that allows developers to self-host applications, databases, or services, including Appwrite, without the hassle of managing the servers. It is an open-source and self-hostable solution that provides one-click deployment for hosting various services, including Appwrite on your servers.
It's intuitive dashboard serves as a centralised command center, allowing users to effortlessly manage and configure all their services from a single, user-friendly interface.
A VPS stands for Virtual Private Server, a machine you can rent on the cloud from various cloud providers. Some examples include Elastic Compute Cloud (EC2) from Amazon AWS, Virtual Machines from Azure, Droplets from DigitalOcean and much more.
Appwrite also offers one-click deployments without using Coolify on DigitalOcean, AWS Marketplace, etc. If you are interested, you can learn more about them on our Github repository.
This blog will focus on droplets from the DigitalOcean, but the same steps should apply to any VPS after you have it set up and running.
Go to DigitalOcean's website and create an account or sign into an existing one.
After logging in to the control panel, click the "Create" menu in the top navigation bar and select "Droplets".
You can choose any region and data centre. (Choosing one near your location might improve performance and latency.)
For OS, select Ubuntu and select the latest version.
Choose a Droplet plan based on your expected workload.
Add block storage if you expect to store large files (optional but recommended for production).
Enable backups for production environments (optional but recommended).
Add your SSH key for secure access:
a. Select an existing key if you've previously added one.
b. Click on "New SSH Key" if creating a new one.
c. Open your system's command line or terminal, and generate a new SSH key pair using ssh-keygen -t rsa -b 4096
.
d. The command will generate two keys, one private and one public. One ending with .pub will be the public one; copy it.
e. Add the public key to DigitalOcean and give it a name.
Choose a hostname that helps identify your Appwrite instance (e.g., appwrite-self-hosting), and then click "Create Droplet". It will take a few minutes to provision the droplet.
Once your Droplet is provisioned, SSH into your server using your private key:
1ssh root@your_server_ip
Now, update your system packages:
1apt update && apt upgrade -y
Set up a firewall (UFW) to protect your server:
1ufw allow OpenSSH2ufw allow 80/tcp3ufw allow 443/tcp4ufw enable
Create a non-root user with sudo privileges (optional but recommended):
1adduser appwrite-admin2usermod -aG sudo
Now that we have a VPS setup, the rest of the process should be the same regardless of which VPS you rent from any cloud provider.
Install Coolify on your server using this command:
1curl -sSL <https://coolify.io/install> | bash
Once the installation is complete, open the Coolify dashboard in your web browser.
The configuration fields will be pre-filled with the recommended settings, but you can customise them. When ready, click the Deploy button to initiate the deployment process.
After deployment, access your Appwrite instance's console by clicking the console link in the Links section of the Appwrite service.
ERR_TOO_MANY_REDIRECTS
IssueWhile accessing the console, you might run into the error ERR_TOO_MANY_REDIRECTS
(Site redirected you too many times). There can be a couple of issues here:
Currently, Coolify will mark all the Appwrite containers as unhealthy due to a lack of health checks configured. Still to verify if a container is healthy manually:
Appwrite also offers Cloud as a subscription-based Backend-As-A-Service (BaaS), eliminating the complexities of managing infrastructure so developers can focus purely on building their apps. With Appwrite Cloud, you get instant access to Appwrite's powerful features — databases, authentication, storage, and functions — without the need to self-host or worry about server maintenance.
Choosing between Appwrite Cloud and self-hosting with Coolify depends on your project's needs. Here's a side-by-side comparison to help you decide:
Aspect | Appwrite Cloud | Self-Hosting with Coolify |
---|---|---|
Ease of setup | Quick and beginner-friendly. | Requires technical expertise to set up VPS, Coolify, and Appwrite. |
Scalability | Automatically adjusts based on demand, ensuring seamless performance. | You must provision additional resources as your app grows. |
Maintenance | Appwrite handles updates, scaling, and security patches. | You are responsible for server maintenance, updates, and security patches. |
Security | Built-in security features, DDoS protection, encryption, and backups without extra configuration. | Security is fully in your hands, configure firewalls, SSL, and backups manually. |
Support | Priority support depending on your Appwrite Cloud plan — faster issue resolution. | Community support or self-managed troubleshooting. |
Cost | Predictable, subscription-based pricing, ideal for teams wanting to avoid unexpected infrastructure costs. | Pay for VPS, storage, and bandwidth and other infrastructural requirements. |
Customization | Limited customization and depends on available features and settings provided by Appwrite. | Highly customizable since you can modify source code and integrate with other services. |
Data sovereignty | Data is stored in Appwrite's cloud infrastructure, which is fully complaint with GDPR regulations. | Data remains on your own infrastructure. |
Self-hosting Appwrite with Coolify combines the strength of an end-to-end backend-as-a-service with the flexibility and autonomy of self-hosting. It enables developers to create powerful applications while retaining data sovereignty and possibly incurring lower operational expenses.
By following this guide, you've successfully deployed a production-capable Appwrite instance that you completely own. As your application grows, the union of Appwrite's robust features and Coolify's efficient management will continue to provide a solid foundation for your development requirements.
To learn more about self-hosting Appwrite on Coolify, you can check out the following resources: