
Ready to migrate n8n to VPS and take full control of your automation workflows? Moving away from n8n cloud is a smart move, but without the right approach, it can quickly go wrong.
This guide walks you through everything you need: backup, environment setup, database transfer, and validation, so you can move with confidence and nothing gets left behind.
Moving n8n from a cloud service to a self hosted VPS can provide greater control, flexibility, and cost efficiency. The comparison table below highlights VPS hosting providers that offer the performance and reliability needed for a successful migration. These providers make it easier to host workflows independently while maintaining stability and scalability. Explore our recommended VPS hosting options.
Top VPS Hosting Choices for a Smooth n8n Self Hosting Migration
| Provider | User Rating | Recommended For | |
|---|---|---|---|
![]() | 4.8 | Scalability | Visit Kamatera |
![]() | 4.6 | Affordability | Visit Hostinger |
![]() | 4.7 | Developers | Visit IONOS |
Why Move from n8n Cloud to a Self-Hosted VPS
n8n cloud is a great starting point. It’s quick to set up and requires no server management, which makes it ideal for testing or small-scale automation workflows. But as your usage grows, its limitations start to show.
The most common reasons users outgrow n8n cloud include:
- Automation cost control: Cloud pricing scales with usage, and costs can climb fast as workflows multiply
- Workflow scalability: Self-hosted instances handle higher volumes without the execution caps imposed by SaaS plans
- Full control: You manage your environment directly, including custom nodes, configuration, and data storage
- SaaS limitations: No restrictions on unlimited workflows, execution history, or third-party integrations
Switching to your own VPS also means your data stays on infrastructure you manage. That matters for teams handling sensitive information or working under compliance requirements.
The self-hosting benefits go beyond cost. You choose the server specs, control the runtime environment, and scale on your own terms. For growing teams, that flexibility is hard to put a price on.
Choosing infrastructure from the #yellow#top n8n hosting providers#yellow# makes the migration process smoother and more reliable, especially if you’re moving a large number of active workflows.
Preparing Your VPS Environment Before Migration

Good n8n environment setup starts before you touch a single file. Rushing this phase is one of the most common reasons migrations fail, so treat it as its own project with clear steps.
Understanding the #yellow#cost breakdown of hosting n8n on a VPS#yellow# helps you choose the right infrastructure before migrating, whether that’s a budget VPS or a more powerful instance for heavy workloads.
Choosing Your Server Specs
Your server needs enough resources to handle your current workflows and room to scale. For most users, a VPS with at least 2 CPU cores, 2GB RAM, and 20GB storage is a solid baseline.
Server configuration planning should also account for expected traffic, the number of active automation workflows, and whether you plan to run PostgreSQL or stick with SQLite.
Installing Dependencies
Once your VPS is provisioned, SSH into it and get your environment ready. You have two main options for running n8n:
- Docker (recommended): Install Docker and Docker Compose for a portable, isolated setup that’s easier to manage and update
- Node.js: Install Node.js directly if you prefer a non-containerized setup, though this requires more manual configuration
Run all install commands with sudo and set correct permissions on your working directories from the start.
Configuring Networking and Access
With dependencies in place, configure your domain and reverse proxy to route traffic to your n8n instance. Nginx is the most common choice here.
Make sure SSL certificates are in place so your instance is accessible over HTTPS before going live. This is essential for securing webhook URLs and keeping your instance safe on the public internet.
A thorough VPS preparation checklist covering networking, dependencies, and n8n environment setup keeps your deployment readiness on track and saves hours of troubleshooting later.
Backing Up Your Existing n8n Data
Before you migrate anything, a full backup is non-negotiable. Even a minor oversight during transfer can result in lost credentials, broken workflows, or missing execution data that’s impossible to recover.
Following proper #yellow#backup and restore strategies for n8n on VPS#yellow# ensures no critical data is lost during migration.
What to Back Up
Make sure you capture all of the following before touching your source VPS:
- Workflows: Export all active and inactive workflows as JSON files
- Credentials: These are stored encrypted, so export them carefully and store your encryption key separately
- Execution history: Download or snapshot recent execution logs if you need them for auditing or debugging
- Database: Export your full SQLite or PostgreSQL database, depending on your current setup
How to Back Up
Use the n8n CLI or the browser-based UI to export workflows and credentials. For the database, export it directly using your database tool of choice.
If you’re running a containerized setup, also back up your Docker volume to preserve your full n8n instance state. Store all backup files in a secure location outside your server before proceeding.
Transferring Workflows, Database, and Credentials
With your backup complete, you’re ready to begin the actual n8n cloud to self-hosted migration. This is the most hands-on part of the process, so work through each step carefully and verify as you go.
Exporting Workflows
Use the n8n UI or CLI to export workflows as JSON files. This is the core of the workflow transfer process, so make sure every workflow is captured, including any that are inactive or in draft state.
Migrating the Database
Database migration n8n requires a clean export from your current instance. Export your SQLite or PostgreSQL database and transfer it to your new VPS via SSH.
Understanding #yellow#database replication for n8n workflows#yellow# helps ensure consistency when transferring large datasets, particularly if you’re switching from SQLite to PostgreSQL during the move.
Transferring Credentials
Credential migration needs extra care. Credentials are encrypted, so you must transfer your encryption key alongside the credential data to ensure they decrypt correctly on the new instance.
Without the correct encryption key, your credentials will be unreadable on the new VPS, and you’ll need to reconfigure every external service connection manually.
Restoring on Your New VPS
Once all files are transferred, import your JSON files and restore your database on the new VPS. Check that custom nodes and community nodes are also reinstalled, as these aren’t included in a standard workflow export.
Data consistency is the goal here. Before moving on, confirm that all workflows, credentials, and nodes are present and correctly configured.
Configuring Environment Variables and Deployment Setup

With your data restored, environment configuration for n8n becomes the next critical step. Getting this wrong is the most common reason a migrated instance fails to start or behaves unexpectedly.
Properly #yellow#managing environment variables in Dockerized n8n#yellow# ensures consistent deployment after migration, so take time to review every setting before launching your instance.
Setting Your Environment Variables
Your deployment variables live in a .env file or directly in your Docker Compose configuration. At minimum, you need to set the following:
- N8N_HOST and N8N_PORT to match your domain and network setup
- WEBHOOK_URL to ensure webhook URLs resolve correctly on the public internet
- DB_TYPE, DB_HOST, and related settings to point to your PostgreSQL or SQLite instance
- N8N_ENCRYPTION_KEY using the same encryption key from your source VPS
- N8N_BASIC_AUTH settings if you’re using authentication to protect access
Docker Setup and Deployment
For Docker setup in n8n, make sure your Docker Compose file references the correct volumes, ports, and environment file. Double-check your folder structure matches what n8n expects before starting the container.
Once everything looks right, start your self hosted instance and check the logs immediately for any startup errors.
Common Configuration Mistakes
Configuration consistency is easy to overlook when moving between environments. Watch out for these frequent missteps:
- Mismatched environment variables between your old and new VPS
- Incorrect base URLs that break webhook URLs and API callbacks
- Wrong database connection strings that prevent n8n from accessing PostgreSQL
- Forgetting to set queue mode if your previous instance was running in a distributed setup
Catching these early saves significant debugging time and keeps your n8n deployment migration on track.
Testing and Validating the Migration

Your migration isn’t complete until you’ve confirmed everything works as expected on the new VPS. Migration validation is the step most people rush, and it’s where overlooked issues tend to surface.
Work through each area methodically before pointing live traffic to your new self hosted instance.
Workflow Testing
Start by triggering a few key workflows manually through the browser. Workflow testing should cover both simple automations and any complex, multi-step automation workflows that rely on external services.
Pay close attention to scheduled workflows and cron jobs. These won’t trigger automatically during testing, so run them manually to confirm they execute and output results correctly.
Verifying Credentials and Integrations
Open each credential in your n8n instance and test the connection. Any credential that relied on your old environment’s encryption key and wasn’t transferred correctly will fail here.
Automation verification should also include checking every API integration and confirming that external services can still connect to your instance via the correct webhook URLs.
Monitoring Logs and Notifications
Once basic testing is done, monitor your logs closely for the first few hours of running n8n on the new VPS. Errors that don’t surface during manual testing often appear once real traffic hits the instance.
Set up notifications for failed workflow executions so you’re alerted immediately if something breaks in production.
Production Readiness Check
Before going fully live, run through this final production readiness checklist:
- Verify all active workflows are enabled and running
- Confirm scheduled workflows trigger at the correct cron intervals
- Check execution history is being recorded correctly
- Delete any test workflows or dummy data created during validation
- Document any configuration changes made during the migration process
Common Migration Mistakes and How to Avoid Them
Even well-planned migrations hit snags. The most frequent issues come down to four avoidable mistakes: missing backups, incorrect environment variables, an underpowered VPS, and DNS misconfiguration.
Double-checking each of these before you begin is always easier than diagnosing them after a failed migration.
Next Steps: What Now?
- Choose your VPS and follow the VPS preparation checklist to get your server ready for migration.
- Export your workflows, credentials, and database from your n8n cloud instance before making any changes.
- Follow this self-host n8n guide to transfer, configure, and validate your new VPS setup step by step.
- Once live, monitor your execution history, logs, and notifications to confirm everything is running as expected.
Further Reading & Useful Resources
- If you’re still deciding on the right server setup, Types of VPS: Do You Know Which VPS You Need? breaks down your options so you can choose the best fit for your n8n instance.
- If you’re weighing your automation options before committing, n8n vs Zapier (2026): Which Automation Tool Is Better? gives you a clear side-by-side comparison.
- If you’re new to containerization, What is Docker Container Hosting & How Is It Managed? explains how Docker works and how to manage it effectively.
- Once your instance is live, How to Tune and Optimize Performance of Nginx Web Server will help you get the most out of your reverse proxy setup.



