Coolify transforms application deployment into a streamlined, self-managed experience, and running it on AWS gives you complete control over your infrastructure. This guide walks you through how to self-host Coolify on AWS using EC2, from initial setup to production-ready configuration.
Who this guide is for: Developers, DevOps engineers, and tech teams who want to deploy their own Coolify instance on AWS infrastructure instead of relying on managed services.
We’ll cover the complete Coolify EC2 installation process, including launching your server and getting Coolify running smoothly. You’ll also learn essential Coolify AWS backup strategies to protect your deployments and data. Finally, we’ll dive into performance optimization and security hardening to ensure your self-hosted deployment platform runs reliably at scale.
By the end, you’ll have a production-ready Coolify setup on AWS that handles your application deployments with confidence.
Prepare Your AWS Environment for Coolify Installation
Select the optimal EC2 instance type for your workload requirements
Choosing the right EC2 instance type for your Coolify AWS deployment sets the foundation for smooth performance. For small to medium projects, t3.medium instances with 2 vCPUs and 4GB RAM work well, while larger deployments benefit from m5.large or m5.xlarge instances. Consider your expected application load, Docker container requirements, and budget constraints. Memory-optimized instances like r5.large excel when running multiple resource-intensive applications through Coolify.
Configure security groups with proper port access and firewall rules
Security groups act as virtual firewalls for your Coolify EC2 installation, controlling inbound and outbound traffic. Create a dedicated security group allowing SSH access (port 22) from your IP, HTTP/HTTPS traffic (ports 80/443) for web access, and port 8000 for Coolify’s dashboard. Restrict SSH access to specific IP addresses rather than allowing worldwide access (0.0.0.0/0). Add custom ports based on your applications’ needs, but follow the principle of least privilege for maximum security.
Set up SSH key pairs for secure server access
SSH key pairs provide secure, password-free access to your Coolify server setup. Generate a new key pair through the AWS console or use existing ones from your local machine. Download the private key file (.pem) and store it securely with proper permissions (chmod 400). Name your key pair descriptively, like “coolify-production-key,” to easily identify it later. Having multiple key pairs for different team members enhances security and access management for your self-host Coolify AWS environment.
Create and attach appropriate IAM roles for AWS service integration
IAM roles enable your Coolify EC2 instance to interact with other AWS services without hardcoding credentials. Create a role with policies for EC2 management, S3 access for backups, and CloudWatch for monitoring. Attach the AmazonEC2FullAccess and AmazonS3FullAccess policies initially, then refine permissions based on your specific needs. This setup supports automated AWS Coolify backup strategies and seamless integration with AWS services for your deployment automation workflows.
Launch and Configure Your EC2 Instance
Deploy Ubuntu server with recommended specifications
For optimal Coolify EC2 installation performance, launch a t3.medium instance with Ubuntu 22.04 LTS, providing 2 vCPUs and 4GB RAM. Configure at least 20GB of EBS storage for the root volume, and attach a secondary 50GB volume for Docker containers and application data. Select a VPC with proper subnet configuration and assign a static Elastic IP for consistent access to your self-hosted Coolify AWS deployment.
Update system packages and install essential dependencies
Connect to your instance via SSH and run sudo apt update && sudo apt upgrade -y
to ensure all packages are current. Install Docker using the official installation script: curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
. Add your user to the Docker group with sudo usermod -aG docker $USER
, then install additional tools like curl
, wget
, git
, and htop
for effective Coolify server setup and monitoring.
Configure swap space for improved memory management
Create a 2GB swap file to prevent memory issues during deployments: sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
. Make the swap permanent by adding /swapfile none swap sw 0 0
to /etc/fstab
. Adjust swappiness to 10 using echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
for optimal AWS Coolify deployment performance and memory management.
Install Coolify on Your EC2 Server
Download and execute the official Coolify installation script
SSH into your EC2 instance and run the official Coolify installation command: curl -fsSL https://cdn.coolify.io/coolify/install.sh | bash
. This automated script handles Docker installation, system dependencies, and Coolify deployment. The process typically takes 5-10 minutes depending on your instance size. Monitor the terminal output for any errors during the self-host Coolify AWS setup process.
Complete the initial setup wizard and domain configuration
Once installation completes, access Coolify through your browser using your EC2 instance’s public IP address on port 8000. The setup wizard guides you through creating your admin account, configuring email settings, and linking your domain. Point your domain’s A record to your EC2 instance’s elastic IP address to ensure consistent access to your Coolify EC2 installation.
Verify successful installation with health checks
Test your Coolify deployment by navigating to the dashboard and checking system status indicators. Verify Docker containers are running with docker ps
and confirm Coolify services are active. Deploy a simple test application to validate the platform’s functionality. Check logs using docker logs coolify
to troubleshoot any issues with your AWS Coolify deployment.
Set up SSL certificates for secure HTTPS access
Enable automatic SSL certificate generation through Coolify’s built-in Let’s Encrypt integration. Navigate to Settings > Configuration and enable SSL for your domain. Coolify automatically handles certificate renewal every 90 days. For custom certificates, upload your SSL files through the dashboard. Ensure your security groups allow HTTPS traffic on port 443 for secure access to your self-hosted deployment platform.
Configure Advanced Coolify Settings
Connect your Git repositories for seamless deployments
Coolify’s Git integration transforms your AWS deployment workflow by connecting directly to GitHub, GitLab, and Bitbucket repositories. Navigate to the Sources tab in your Coolify dashboard and add your Git provider using personal access tokens or SSH keys. Once connected, you can deploy applications with automatic builds triggered by code pushes. The platform supports multiple deployment strategies including Docker builds, static sites, and various frameworks. Configure webhooks to enable real-time deployments whenever you push changes to specific branches, creating a streamlined CI/CD pipeline on your self-hosted AWS infrastructure.
Set up environment variables and secrets management
Environment variables and secrets management in Coolify provides secure configuration handling for your deployed applications on AWS. Access the Environment Variables section within each application’s settings to define key-value pairs for database connections, API keys, and application-specific configurations. Coolify automatically encrypts sensitive data and injects variables during deployment without exposing them in your codebase. You can organize variables by environment (production, staging, development) and use the built-in secrets management to handle sensitive information like database passwords and third-party API tokens. The platform also supports importing variables from .env files and bulk editing capabilities.
Configure custom domains and DNS settings
Custom domain configuration in your self-hosted Coolify instance requires proper DNS management and SSL certificate handling. Add your domain through the Domains section of your application settings, then update your DNS provider to point your domain to your EC2 instance’s public IP address. Coolify automatically generates and manages SSL certificates using Let’s Encrypt, ensuring secure HTTPS connections for all your deployed applications. You can configure multiple domains per application, set up redirects, and manage subdomains. For advanced setups, configure CNAME records for www redirects and consider using AWS Route 53 for enhanced DNS management and health checks.
Enable monitoring and logging features
Coolify’s built-in monitoring and logging capabilities provide essential insights into your applications running on AWS EC2. Enable application logs through the Logs tab to view real-time output from your deployed services, including build logs, runtime errors, and custom application logging. The monitoring dashboard displays resource usage metrics including CPU, memory, and disk utilization for your containers. Configure log retention policies to manage storage space on your EC2 instance and set up log aggregation for multiple applications. You can also integrate external monitoring solutions like Grafana or Prometheus by exposing metrics endpoints and configuring custom monitoring dashboards for comprehensive AWS Coolify deployment oversight.
Implement Robust Backup Strategies
Set up automated database backups to AWS S3
Configure automated PostgreSQL backups by creating a backup script that dumps your Coolify database and uploads it to S3. Set up AWS CLI with proper IAM permissions for S3 access, then create a cron job running pg_dump
commands with gzip compression. Store backups with timestamped filenames and implement lifecycle policies to automatically delete old backups after 30 days to manage storage costs.
Configure application data backup schedules
Schedule regular backups of your Coolify application data using AWS S3 sync commands. Create separate backup jobs for Docker volumes, configuration files, and deployment artifacts. Run incremental backups every 6 hours and full backups daily during low-traffic periods. Use S3 versioning to maintain multiple backup versions and set up cross-region replication for additional redundancy in your AWS Coolify deployment infrastructure.
Create full system snapshots using AWS EBS
Enable automated EBS snapshots through AWS Console or CLI to capture complete system states of your EC2 Coolify server. Schedule daily snapshots during maintenance windows and retain them for 7-14 days based on your recovery requirements. Tag snapshots with descriptive names including dates and backup types. EBS snapshots provide point-in-time recovery capabilities and can quickly restore your entire Coolify installation if system failures occur.
Test backup restoration procedures for disaster recovery
Regularly validate your AWS Coolify backup strategies by performing test restorations on separate EC2 instances. Create a monthly disaster recovery drill where you restore database backups, application data, and EBS snapshots to verify data integrity and restoration times. Document the complete recovery process, including DNS updates and SSL certificate restoration. Test different failure scenarios to ensure your self-hosted Coolify deployment can recover from various disaster situations.
Optimize Performance and Security
Configure CloudWatch monitoring for system metrics
Setting up CloudWatch monitoring gives you complete visibility into your Coolify performance optimization on AWS. Create custom dashboards to track CPU utilization, memory usage, disk I/O, and network traffic patterns. Configure alarms for critical thresholds like high memory consumption or disk space running low. Enable detailed monitoring on your EC2 Coolify configuration to collect metrics every minute instead of the default five-minute intervals. Set up log groups to capture application logs, system logs, and Docker container metrics from your self-hosted CI/CD AWS environment. This proactive monitoring approach helps you identify bottlenecks before they impact your deployment platform’s performance.
Implement automatic scaling policies for traffic spikes
Auto Scaling Groups protect your Coolify server setup from unexpected traffic surges by automatically launching additional EC2 instances when demand increases. Create launch templates that include your Coolify configuration and dependencies, then define scaling policies based on CPU utilization or custom CloudWatch metrics. Set minimum and maximum instance counts to control costs while maintaining availability. Configure target tracking scaling policies that maintain optimal performance levels during traffic spikes. Load balancers distribute incoming requests across multiple instances, ensuring your AWS Coolify deployment remains responsive even during peak usage periods.
Set up firewall rules and security hardening measures
Security hardening starts with configuring restrictive security groups that only allow necessary traffic to your Coolify EC2 installation. Block all unnecessary ports and limit SSH access to specific IP addresses or VPN ranges. Install fail2ban to automatically block brute force attempts and configure UFW firewall with strict rules. Enable VPC Flow Logs to monitor network traffic patterns and detect suspicious activity. Implement regular security updates through automated patching schedules and disable unused services to reduce attack surface. Use AWS Systems Manager for secure remote access instead of traditional SSH keys, and enable CloudTrail logging to audit all API calls and configuration changes on your self-host Coolify AWS infrastructure.
Maintain and Monitor Your Coolify Instance
Schedule regular system updates and maintenance windows
Setting up automated system updates keeps your self-host Coolify AWS deployment secure and running smoothly. Configure unattended-upgrades on your EC2 instance to handle security patches automatically, but schedule manual updates for major system changes during low-traffic periods. Create maintenance windows every two weeks to restart services, clean temporary files, and verify backup integrity. Use AWS Systems Manager to automate patching schedules and track update compliance across your Coolify server setup. Document your maintenance procedures and test rollback plans before applying updates to avoid downtime.
Monitor resource usage and cost optimization
AWS CloudWatch provides comprehensive monitoring for your Coolify EC2 installation, tracking CPU usage, memory consumption, disk I/O, and network traffic. Set up custom dashboards to visualize application deployment patterns and identify resource bottlenecks before they impact performance. Use AWS Cost Explorer to monitor spending trends and right-size your instances based on actual usage patterns. Consider implementing auto-scaling groups if your self-hosting deployment platform experiences variable loads. Enable detailed billing alerts to catch unexpected cost spikes early and optimize your AWS deployment automation expenses.
Set up alerting for critical system events
Configure CloudWatch alarms to monitor critical metrics like disk space, memory usage above 80%, and service failures on your Coolify performance optimization setup. Create SNS topics to send instant notifications via email or Slack when your deployment platform encounters issues. Set up log-based alerts for application deployment failures, authentication errors, and database connection problems. Use AWS EventBridge to trigger automated responses for common issues like service restarts or scaling actions. Include health check monitoring for your applications and infrastructure components to catch problems before users notice them.
Setting up Coolify on AWS EC2 gives you a powerful self-hosted deployment platform that puts you in complete control of your applications. From launching the right EC2 instance to configuring backups and security settings, each step builds toward a robust hosting environment that can handle your development and production needs. The combination of AWS’s reliable infrastructure with Coolify’s user-friendly interface creates an ideal setup for teams looking to break free from expensive hosting solutions.
Your Coolify instance won’t run itself, though. Regular monitoring, performance tuning, and keeping your backups current are what separate a hobby project from a professional deployment platform. Start with the basics we’ve covered, get comfortable with the setup, and then dive into the advanced features as your needs grow. Your applications deserve a hosting environment that scales with your ambitions, and this AWS-powered Coolify setup delivers exactly that.