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.
π Deploying InsForge to Azure Virtual Machines (Extended Guide)
This guide provides comprehensive, step-by-step instructions for deploying, managing, and securing InsForge on an Azure Virtual Machine (VM) 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
- An active Azure account.
- An SSH client to connect to the virtual machine.
- Basic familiarity with the Linux command line.
Step 1: π₯οΈ Create an Azure Virtual Machine
- Log in to the Azure Portal and navigate to Virtual machines.
- Click + Create > Azure virtual machine.
- Basics Tab:
- Resource Group: Create a new one (e.g.,
insforge-rg). - Virtual machine name:
insforge-vm. - Image: Ubuntu Server 22.04 LTS or newer.
- Size:
Standard_B2s(2 vCPUs, 4 GiB memory) is a good start. For production, considerStandard_B4ms(4 vCPUs, 16 GiB memory). - Authentication type: SSH public key.
- SSH public key source: Generate new key pair. Name it
insforge-key.
- Resource Group: Create a new one (e.g.,
- Networking Tab:
- In the Network security group section, click Create new.
- Add the following inbound port rules to allow traffic:
22(SSH)80(HTTP for Nginx)443(HTTPS for Nginx/SSL)7130(InsForge API and dashboard)
- Review and Create:
- Click Review + create, then Create.
- When prompted, Download private key and create resource. Save the
.pemfile securely. - Once deployed, find and copy your VMβs Public IP address.
Step 2: βοΈ Connect and Set Up the Server
-
Connect via SSH:
Open your terminal, give your key the correct permissions, and connect to the VM.
-
Update System Packages:
- Install Docker: Follow the official, up-to-date instructions on the Docker website to install Docker Engine on Ubuntu: https://docs.docker.com/engine/install/ubuntu/
-
Add Your User to the Docker Group:
This step allows you to run Docker commands without
sudo.Verify it works. This command should now run withoutsudo:π‘ Note: If
docker psdoesnβt work, log out of your SSH session and log back in, then try again. β οΈ Security Note: Adding a user to thedockergroup grants them root-equivalent privileges. This is acceptable for a single-user VM but be cautious on shared systems. -
Install Git:
Step 3: π Deploy InsForge
-
Clone the Repository:
Navigate to your home directory and clone the InsForge project.
-
Create Environment Configuration:
Create your
.envfile from the example and open it for editing..env.examplelists every supported variable with comments. For a basic deployment you only need to set a few. Set these values and update the API URLs to your VMβs public IP:The rest of.env.examplecovers optional features (OpenRouter, Vercel deployments, OAuth providers). Leave those blank unless you need them.Generate a Secure JWT Secret: Run this on your VM and paste the result into
JWT_SECRET: -
Start InsForge Services:
Pull the Docker images and start all services in the background.
-
Verify Services:
Check that all four containers are running.
You should see the
postgres,postgrest,insforge, anddenoservices running.
Step 4: π Access Your InsForge Instance
-
Test Backend API:
Use
curlto check the health endpoint.You should see a response like:{"status":"ok", ...} -
Access Dashboard:
Open your browser and navigate to:
http://<your-vm-public-ip>:7130Log in with theADMIN_EMAILandADMIN_PASSWORDyou set in your.envfile.
Step 5: π Configure Domain (Optional but Recommended)
-
Update DNS Records:
In your domain providerβs DNS settings, add two A records pointing to your VMβs Public IP address:
api.yourdomain.comβ<your-vm-public-ip>app.yourdomain.comβ<your-vm-public-ip>
-
Install and Configure Nginx as a Reverse Proxy:
Paste the following configuration:Enable the configuration and reload Nginx:
-
Install SSL Certificate with Certbot:
Follow the prompts. Certbot will handle the rest.
-
Update
.envwith HTTPS URLs: Edit your.envfile and update the URLs.Change the URLs tohttps:Restart the services for the changes to take effect:
π§ Management & Maintenance
- View Logs:
docker compose logs -f(all services) ordocker compose logs -f insforge(specific service). - Stop Services:
docker compose down - Restart Services:
docker compose restart - Update InsForge: Run these from
~/InsForge/deploy/docker-compose. The images are prebuilt, so pull the latest tags instead of rebuilding. - Backup Database: Run from
~/InsForge/deploy/docker-compose.
π Troubleshooting
- Services Wonβt Start: Check
docker compose logsfor errors. Ensure you have enough disk space (df -h) and memory (free -h). - Port Already in Use: Check which process is using the port with
sudo netstat -tulpn | grep :7130. - Out of Memory: Consider upgrading your Azure VM to a size with more RAM.
π Cost Estimation
Disclaimer: Prices are estimates based on Pay-As-You-Go rates in a common region (e.g., East US) and can vary. Always check the official Azure Pricing Calculator for the most accurate information. On Azure, you pay for the VMβs resources (CPU, RAM, Storage), which are shared by all the Docker services you run on it.
Free Tier (for Testing)
- Cost: ~$0/month for the first 12 months.
- Resources: Azure provides a free tier that includes 750 hours/month of a
B1sburstable VM. - Limitations: This VM has very limited resources (1 vCPU, 1 GiB RAM) and may run slowly. Itβs suitable only for basic testing and familiarization, not for active development or production.
Starter Setup (for Development & Small Projects)
- Cost: ~40/month
- Resources: This estimate is for a
Standard_B2sVM (2 vCPU, 4 GiB RAM) running all the InsForge Docker containers. - Breakdown: The cost primarily consists of the VM compute hours. It also includes the OS disk storage and a static public IP address. This single VM runs your database, backend, Deno, and all other services.
Production Setup (for Scalability & Reliability)
For production, you can choose between an all-in-one, larger VM or a more robust setup using managed services.-
Option A: All-in-One Larger VM
- Cost: ~170/month
- Resources: A more powerful
Standard_B4msVM (4 vCPU, 16 GiB RAM) to handle higher traffic and all services. - Pros: Simple to manage, consolidated cost.
- Cons: Database and application share resources, which can create performance bottlenecks. Scaling requires upgrading the entire VM.
-
Option B: Managed Services (Recommended for Production)
- Cost: ~$120+/month (highly variable)
- Resources:
- Application VM: A
Standard_B2sVM for the app services (InsForge, PostgREST, Deno).(~$30/month) - Managed Database: Use Azure Database for PostgreSQL for reliability, automated backups, and scaling.
(~$40+/month for a starter tier)
- Application VM: A
- Pros: Highly reliable and scalable. Database performance is isolated and guaranteed. Managed backups and security.
- Cons: More complex setup, costs are distributed across multiple services.
π Security Best Practices
- Change Default Passwords: Always update admin and database passwords.
- Enable Firewall: Use Azure Network Security Groups (NSGs) to restrict access to necessary ports and IP addresses.
- Regular Updates: Periodically run
sudo apt update && sudo apt upgrade -yand update InsForge. - Backup Regularly: Automate database and configuration backups.