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-composeVerify installation:
docker --version
docker-compose --versionPull the Appwrite setup script:
curl -sL https://appwrite.io/install | bashOr manually clone the repository:
git clone https://github.com/appwrite/appwrite.git
cd appwriteModify the .env file:
cp .env.example .env
nano .envUpdate 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.comSave and exit.
If you want to use Nginx as a reverse proxy, install it:
sudo apt install -y nginxCreate a new Nginx configuration:
sudo nano /etc/nginx/sites-available/appwriteAdd 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 nginxRun Appwrite with Docker:
docker-compose up -dTo 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.comEnsure auto-renewal:
sudo certbot renew --dry-run- Open
https://console.yourdomain.comin 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! 🚀