pip install -r requirements.txt
This repository provides instructions and configuration for hosting n8n on Fly.io. n8n is a workflow automation tool that allows you to connect various services and automate tasks.
- A Fly.io account
- Fly CLI installed on your machine
- Basic knowledge of command line operations
For Windows, open PowerShell and run:
powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"
For other operating systems, visit Fly.io's installation guide.
- Clone this repository:
git clone https://github.com/gijs-epping/n8n-fly.git
cd n8n-fly
- Launch your app with Fly.io:
fly launch
During the launch process, you'll need to configure several settings:
-
App Name: Choose a unique name for your application (e.g., "n8ntestonfly")
- This will be used in your app's URL:
https://[app-name].fly.dev
- This will be used in your app's URL:
-
Region: Select your preferred region (e.g., "Amsterdam, Netherlands")
- Choose a region close to your location for better performance
-
Resources: Default configuration includes:
- Shared CPU (1x)
- 1GB RAM
- No additional services (Postgres, Redis, etc.)
-
Environment Variables: Make sure to set these in your
fly.toml
:N8N_HOST
: Must match your app URLWEBHOOK_URL
: Must match your app URL
- The application will automatically stop when idling to save resources
- Your app will be accessible at
https://[app-name].fly.dev
- First-time access will require setting up an owner account
app = "n8ntestonfly" # Your unique app name
primary_region = "ams" # Your chosen region
After deployment, you can access your n8n instance at:
https://[app-name].fly.dev/
- Visit your newly deployed app URL
- Complete the owner account setup:
- Enter your email
- Create a secure password (8+ characters, including numbers and capital letters)
- Fill in your first and last name
- Issue:
fly launch
failsSolution:Error: failed to fetch an image or build from source
- Verify your internet connection
- Check if Fly.io services are up
- Run
fly status
to check your authentication - Try
fly auth login
to reauthenticate
- Issue: Application not starting properly
Solution:
- Check your
fly.toml
configuration:fly status fly logs
- Verify these essential configurations:
app = "your-unique-app-name" primary_region = "ams" # or your chosen region [env] N8N_HOST = "https://your-app-name.fly.dev" WEBHOOK_URL = "https://your-app-name.fly.dev"
- Check your
- Issue: Cannot access the n8n interface
Solutions:
- Verify DNS propagation:
fly status
- Check if the application is running:
fly apps list fly status
- Inspect logs for errors:
fly logs
- Verify DNS propagation:
- Issue: Application crashes or performs poorly
Solutions:
- Check resource usage:
fly status
- Adjust resources in
fly.toml
:[services] [[services.concurrency]] type = "connections" hard_limit = 25 soft_limit = 20 [[vm]] cpu_kind = "shared" cpus = 1 memory_mb = 1024
- Check resource usage:
- Issue: Application stops unexpectedly
Note: This is expected behavior as mentioned in deployment notes
Solutions:
- Check auto-stop settings:
fly status
- Modify auto-stop behavior in
fly.toml
:[services] auto_stop_machines = true auto_start_machines = true min_machines_running = 0
- Check auto-stop settings:
- Issue: Cannot connect to database
Solutions:
- Verify database settings:
fly redis list # for Redis fly postgres list # for PostgreSQL
- Check connection strings in environment variables
- Ensure database service is running:
fly status
- Verify database settings:
Useful commands for troubleshooting:
fly logs # View application logs
fly status # Check application status
fly secrets list # View configured secrets
fly regions list # View available regions
fly scale show # Check current resource allocation
If you're still experiencing issues:
- Visit Fly.io Status Page
- Check n8n Community Forums
- Review Fly.io Documentation
- Join n8n Discord
- Open an issue in this repository with:
- Detailed error description
- Relevant logs
- Steps to reproduce
- Your
fly.toml
configuration (with sensitive data removed)
For support, please:
- Check the n8n documentation
- Visit the Fly.io documentation
- Open an issue in this repository
Contributions are welcome! Please feel free to submit a Pull Request.