Chirag's Blog

Self-hosting Appwrite with Coolify

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.

What is Coolify?

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.

Coolify Dashboard

Setting up a VPS

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.

  1. Go to DigitalOcean's website and create an account or sign into an existing one.

  2. After logging in to the control panel, click the "Create" menu in the top navigation bar and select "Droplets".

  3. You can choose any region and data centre. (Choosing one near your location might improve performance and latency.)

  4. Create Droplet

  5. For OS, select Ubuntu and select the latest version.

  6. Choose a Droplet plan based on your expected workload.

  7. Add block storage if you expect to store large files (optional but recommended for production).

  8. Enable backups for production environments (optional but recommended).

  9. Add your SSH key for secure access:

Adding SSH Key

a. Select an existing key if you've previously added one.

Add SSH Key

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.

Generate SSH Key

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.

Add SSH Key to DigitalOcean

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.

Initial server setup

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 OpenSSH
2ufw allow 80/tcp
3ufw allow 443/tcp
4ufw enable

Create a non-root user with sudo privileges (optional but recommended):

1adduser appwrite-admin
2usermod -aG sudo

Setting up Appwrite on Coolify

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.

  1. Sign up for a new account.
  2. Click the Create Project button to start a new project.
  3. Select or create an environment type. By default, a production environment is already available.
  4. Click Add new resource.
  5. Search for and select Appwrite from the list of services.

Add Appwrite

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.

Troubleshooting common Issues

ERR_TOO_MANY_REDIRECTS Issue

While 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:

  1. Since Coolify uses its configuration of Traefik, which is a reverse proxy and load balancer, instead of the official Appwrite one, you will have to turn off the Strip Prefixes option in the Settings page for the Appwrite console and Appwrite Realtime service.
  2. If you are using Cloudflare to manage your deployment's DNS and turning off the above option doesn't help, you must update the SSL/TLS encryption setting to Full in the Cloudflare dashboard. From the dashboard, navigate to Your Domain -> SSL/TLS -> Overview and change the setting to Full.

Container Health Checks Failing

Container Health Checks Failing

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:

  1. Check container logs in the Coolify dashboard for specific error messages.
  2. Ensure your server meets the minimum resource requirements.
  3. Verify that all required ports are open and not blocked by firewalls.
  4. Check for Docker storage issues with df -h to ensure you haven't run out of disk space.

Appwrite Cloud vs Self-hosting with Coolify

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:

AspectAppwrite CloudSelf-Hosting with Coolify
Ease of setupQuick and beginner-friendly.Requires technical expertise to set up VPS, Coolify, and Appwrite.
ScalabilityAutomatically adjusts based on demand, ensuring seamless performance.You must provision additional resources as your app grows.
MaintenanceAppwrite handles updates, scaling, and security patches.You are responsible for server maintenance, updates, and security patches.
SecurityBuilt-in security features, DDoS protection, encryption, and backups without extra configuration.Security is fully in your hands, configure firewalls, SSL, and backups manually.
SupportPriority support depending on your Appwrite Cloud plan — faster issue resolution.Community support or self-managed troubleshooting.
CostPredictable, subscription-based pricing, ideal for teams wanting to avoid unexpected infrastructure costs.Pay for VPS, storage, and bandwidth and other infrastructural requirements.
CustomizationLimited 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 sovereigntyData is stored in Appwrite's cloud infrastructure, which is fully complaint with GDPR regulations.Data remains on your own infrastructure.

Conclusion

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.

More resources

To learn more about self-hosting Appwrite on Coolify, you can check out the following resources: