Documentation Index
Fetch the complete documentation index at: https://docs.insforge.dev/llms.txt
Use this file to discover all available pages before exploring further.
Deploy InsForge to AWS EC2
This guide will walk you through deploying InsForge on an AWS EC2 instance using Docker Compose.This cloud walkthrough is community-maintained and can lag the latest InsForge release. The canonical, always-current setup is the
deploy/docker-compose/ directory in the InsForge repo.π Prerequisites
- AWS Account with EC2 access
- Basic knowledge of SSH and command-line operations
- Domain name (optional, for custom domain setup)
π Deployment Steps
1. Create and Configure EC2 Instance
1.1 Launch EC2 Instance
- Log into AWS Console and navigate to EC2 Dashboard
- Click βLaunch Instanceβ
- Configure Instance:
- Name:
insforge-server(or your preferred name) - AMI: Ubuntu Server 24.04 LTS (HVM), SSD Volume Type
- Instance Type:
t3.mediumor larger (minimum 2 vCPU, 4 GB RAM)- For production:
t3.large(2 vCPU, 8 GB RAM) recommended - For testing:
t3.small(2 vCPU, 2 GB RAM) minimum
- For production:
- Key Pair: Create new or select existing key pair (download and save the
.pemfile) - Storage: 30 GB gp3 (minimum 20 GB recommended)
- Name:
1.2 Configure Security Group
Create or configure security group with the following inbound rules:| Type | Protocol | Port Range | Source | Description |
|---|---|---|---|---|
| SSH | TCP | 22 | My IP | SSH access |
| HTTP | TCP | 80 | 0.0.0.0/0 | HTTP access |
| HTTPS | TCP | 443 | 0.0.0.0/0 | HTTPS access |
| Custom TCP | TCP | 7130 | 0.0.0.0/0 | Dashboard + API |
| Custom TCP | TCP | 5432 | 0.0.0.0/0 | PostgreSQL (optional) |
β οΈ Security Note: For production, restrict PostgreSQL (5432) to specific IP addresses or remove external access entirely. Consider using a reverse proxy (nginx) and exposing only ports 80/443.
1.3 Allocate Elastic IP (Recommended)
- Navigate to Elastic IPs in EC2 Dashboard
- Click Allocate Elastic IP address
- Associate the Elastic IP with your instance
2. Connect to Your EC2 Instance
3. Install Dependencies
3.1 Update System Packages
3.2 Install Docker
3.3 Add Your User to Docker Group
After installing Docker, you need to add your user to thedocker group to run Docker commands without sudo:
π‘ Note: If docker ps doesnβt work immediately, log out and log back in via SSH, then try again.
β οΈ Security Note: Adding a user to the docker group grants them root-equivalent privileges on the system. This is acceptable for single-user environments like your EC2 instance, but be cautious on shared systems.
3.4 Install Git
4. Deploy InsForge
4.1 Clone Repository
4.2 Create Environment Configuration
Copy the example template to create your.env file:
deploy/docker-compose/.env.example. These are the variables you must set:
.env.example template carries the remaining variables and their defaults, so editing the copied file is enough.
Generate Secure Secrets:
π‘ Important: Save these secrets securely. Youβll need them if you ever migrate or restore your instance.
4.3 Start InsForge Services
Ctrl+C to exit log view.
4.4 Verify Services
5. Access Your InsForge Instance
5.1 Test Backend API
5.2 Access Dashboard
Open your browser and navigate to:ADMIN_EMAIL and ADMIN_PASSWORD you set in .env.
6. Configure Domain (Optional but Recommended)
6.1 Update DNS Records
Add DNS A records pointing to your EC2 Elastic IP:6.2 Install Nginx Reverse Proxy
6.3 Install SSL Certificate (Recommended)
.env file with HTTPS URLs:
π§ Management & Maintenance
View Logs
Stop Services
Restart Services
Update InsForge
InsForge ships prebuilt images, so an update is a pull and restart. Run this from~/insforge/deploy/docker-compose:
Backup Database
Run these from~/insforge/deploy/docker-compose:
Monitor Resources
π Troubleshooting
Services Wonβt Start
Cannot Connect to Database
Port Already in Use
Out of Memory
Consider upgrading to a larger instance type:SSL Certificate Issues
π Performance Optimization
For Production Workloads
- Upgrade Instance Type: Use
t3.largeort3.xlarge - Enable Auto-scaling: Set up Application Load Balancer with auto-scaling groups
- Use RDS: Migrate from containerized PostgreSQL to AWS RDS for better reliability
- Enable CloudWatch: Monitor metrics and set up alarms
- Configure Backups: Set up automated daily backups
- Use S3 for Storage: Configure S3 bucket for file uploads instead of local storage
Database Optimization
π Security Best Practices
- Change Default Passwords: Update admin and database passwords
- Enable Firewall: Use AWS Security Groups effectively
- Regular Updates: Keep system and Docker images updated
- SSL/TLS: Always use HTTPS in production
- Backup Regularly: Automate database backups
- Monitor Logs: Set up log monitoring and alerts
- Limit SSH Access: Restrict SSH to specific IP addresses
- Use IAM Roles: Instead of AWS access keys where possible
π Support & Resources
- Documentation: https://docs.insforge.dev
- GitHub Issues: https://github.com/insforge/insforge/issues
- Discord Community: https://discord.com/invite/MPxwj5xVvW
π Cost Estimation
Monthly AWS Costs (approximate):| Component | Type | Monthly Cost |
|---|---|---|
| EC2 Instance | t3.medium | ~$30 |
| Storage (30 GB) | EBS gp3 | ~$3 |
| Elastic IP | (if running 24/7) | $0 |
| Data Transfer | First 100GB free | Variable |
| Total | ~$33/month |
π‘ Cost Optimization: Use AWS Savings Plans or Reserved Instances for long-term deployments to save up to 70%.
Congratulations! π Your InsForge instance is now running on AWS EC2. You can start building applications by connecting AI agents to your backend platform. For other production deployment strategies, check out our deployment guides.