Self-hosting n8n on your own VPS gives you complete control over your automation workflows without the limitations of cloud plans. With providers like hostinger or netcup, you can set up a powerful automation server that scales with your needs.
Why Self-Host n8n?
When you self-host n8n, you unlock several advantages over the cloud version:
- Unlimited executions: No monthly limits on workflow runs
- Custom integrations: Install any community nodes or create your own
- Data privacy: Keep sensitive data on your own infrastructure
- Cost efficiency: Pay only for server resources, not per execution
- Full customization: Configure n8n exactly to your needs
VPS Requirements and Provider Selection
For optimal n8n performance, choose a VPS with these minimum specifications:
- RAM: 2GB minimum (4GB recommended for complex workflows)
- CPU: 2 cores minimum
- Storage: 20GB SSD minimum
- OS: Ubuntu 20.04 LTS or newer
Both hostinger and netcup offer excellent VPS solutions that meet these requirements. hostinger provides user-friendly management panels, while netcup offers competitive pricing for European users.
Setting Up n8n with Docker
Docker is the most reliable way to deploy n8n on your VPS. First, install Docker and Docker Compose:
Install Docker
Connect to your VPS via SSH and run these commands:
Update your system:
sudo apt update && sudo apt upgrade -y
Install Docker:
curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh
Add your user to Docker group:
sudo usermod -aG docker $USER
Deploy n8n Container
Create a directory for your n8n installation and set up the Docker Compose file:
mkdir n8n-docker && cd n8n-docker
Create a docker-compose.yml file with this configuration for n8n:
Database Configuration
While n8n works with SQLite by default, PostgreSQL is recommended for production environments. Add a PostgreSQL service to your Docker Compose setup for better performance and reliability.
Configure your n8n instance to use PostgreSQL by setting the appropriate environment variables in your Docker Compose file. This ensures your workflow data is stored securely and can handle concurrent executions efficiently.
SSL and Domain Setup
Security is crucial when self-hosting n8n. Set up SSL certificates using Let's Encrypt and configure a reverse proxy with Nginx:
- Domain configuration: Point your domain to your VPS IP address
- Nginx setup: Configure reverse proxy for n8n
- SSL certificates: Use Certbot for automatic certificate management
- Firewall rules: Open only necessary ports (80, 443, 22)
Performance Optimization
To get the best performance from your self-hosted n8n instance:
- Resource monitoring: Use tools like htop to monitor CPU and memory usage
- Workflow optimization: Design efficient workflows to minimize resource consumption
- Regular backups: Implement automated database backups
- Update management: Keep n8n and system packages updated
Maintenance and Monitoring
Regular maintenance ensures your n8n installation runs smoothly. Set up log rotation, monitor disk space, and create backup strategies for your workflow data.
Consider implementing monitoring solutions to track your n8n instance's health and performance metrics. This helps identify issues before they affect your automation workflows.
Self-hosting n8n on a VPS from providers like hostinger or netcup gives you the freedom to build unlimited automation workflows while maintaining full control over your data and infrastructure.
This post was created with tools we use and recommend: n8n for workflow automation, Turbotic as an AI-native automation alternative, ElevenLabs for AI voiceover, Placid for visual content creation, and Hostinger for reliable VPS hosting. Some links are affiliate links.