To install Appwrite using Docker with a custom domain, follow these steps:
Ensure that Docker and Docker Compose are installed on your server.
sudo apt update && sudo apt install -y docker.io docker-compose
Verify installation:
docker --version
docker-compose --version
Pull the Appwrite setup script:
curl -sL https://appwrite.io/install | bash
Or manually clone the repository:
git clone https://github.com/appwrite/appwrite.git
cd appwrite
Modify the .env
file:
cp .env.example .env
nano .env
Update these values to match your custom domain:
_APP_DOMAIN=yourdomain.com
_APP_DOMAIN_TARGET=yourdomain.com
_APP_CONSOLE_DOMAIN=console.yourdomain.com
_APP_API_DOMAIN=api.yourdomain.com
_APP_GRAPHQL_DOMAIN=graphql.yourdomain.com
Save and exit.
If you want to use Nginx as a reverse proxy, install it:
sudo apt install -y nginx
Create a new Nginx configuration:
sudo nano /etc/nginx/sites-available/appwrite
Add the following configuration:
server {
listen 80;
server_name yourdomain.com api.yourdomain.com console.yourdomain.com graphql.yourdomain.com;
location / {
proxy_pass http://localhost:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Enable the configuration:
sudo ln -s /etc/nginx/sites-available/appwrite /etc/nginx/sites-enabled/
sudo systemctl restart nginx
Run Appwrite with Docker:
docker-compose up -d
To enable SSL using Certbot, install it and generate an SSL certificate:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d api.yourdomain.com -d console.yourdomain.com -d graphql.yourdomain.com
Ensure auto-renewal:
sudo certbot renew --dry-run
- Open
https://console.yourdomain.com
in a browser. - Login and start managing your Appwrite instance.
By following these steps, you now have Appwrite running on Docker with a custom domain. Let me know if you need further customization or troubleshooting! 🚀