Migrating n8n from Cloud to Self-Hosted VPS

Migrating n8n from Cloud to Self-Hosted VPS

Migrating n8n from Cloud to Self-Hosted VPS blog

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

ProviderUser RatingRecommended For 
Kamatera Logo4.8ScalabilityVisit Kamatera
4.6AffordabilityVisit Hostinger
4.7DevelopersVisit IONOS

Takeaways
  • This self-host n8n guide covers everything from backup to validation so nothing gets left behind during your migration.
  • Move n8n to VPS to gain full control over your environment, costs, and workflow scalability.
  • Always back up your workflows, credentials, and database before you migrate n8n to VPS.
  • Use Docker Compose and a reverse proxy with SSL certificates for a stable, secure deployment.
  • Transfer n8n workflows to VPS carefully by verifying credentials, custom nodes, and encryption keys after restore.
  • Always test scheduled workflows, API integrations, and webhook URLs before going live.

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

Docker Compose Deployment Dashboard

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.

Ultahost

Launch, Scale, and Manage your website with high-performance Web Hosting and VPS.
Visit Site Coupons6

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

Running Containers and Deployment Logs

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

Workflow Execution and Output Results

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.

Build Your App Now with Hostinger Horizons
Turn your idea into a powerful app in minutes with Hostinger Horizons. No coding, no hassle, just AI-powered building that brings your vision to life.
Visit Hostinger

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.

VPS
Cheap VPS
best option

Next Steps: What Now?

  1. Choose your VPS and follow the VPS preparation checklist to get your server ready for migration.
  2. Export your workflows, credentials, and database from your n8n cloud instance before making any changes.
  3. Follow this self-host n8n guide to transfer, configure, and validate your new VPS setup step by step.
  4. Once live, monitor your execution history, logs, and notifications to confirm everything is running as expected.

Further Reading & Useful Resources

Frequently Asked Questions

Do I need Docker to migrate n8n to VPS?

Docker is not strictly required, but it is strongly recommended. Using Docker Compose makes your n8n setup easier to manage, update, and back up, especially when you have many workflows running in production. It also simplifies volume management through Docker volumes, keeping your data organized and portable.

How do I make my self-hosted n8n instance accessible over HTTPS?

Point your domain to your VPS, set up a reverse proxy like Nginx, and encrypt certificates using a tool like Certbot. Once configured, your instance will be accessible over HTTPS, which is required for webhook URLs and secure API connections.

Can I use the n8n CLI to import workflows after migration?

Yes. The CLI is a reliable way to import workflows and credentials after you migrate. It gives you more control over the process than the browser UI, particularly when dealing with many workflows at once.

Will my credentials still work after I move from cloud to a self-hosted instance?

They will, as long as you transfer your encryption key correctly. Without it, n8n cannot decrypt your credentials on the new VPS and you will need to reconnect every service manually.

What is queue mode and do I need it?

Queue mode allows n8n to distribute workflow executions across multiple workers, which improves reliability under heavy load. It is not enabled by default, but it is worth considering if you run many workflows simultaneously and need consistent output.

How do I connect custom nodes after migration?

Reinstall your nodes on the new VPS using sudo if required, then restart your n8n instance. The CLI can help verify that all nodes are correctly registered and that your workflows can connect to the right integrations and API endpoints.

How much RAM and CPU does my VPS need to run n8n reliably?

The right specs depend on how many workflows you run and how frequently they execute. A VPS with 2 CPU cores and 2GB RAM is a reasonable starting point, but you may need to scale up your resources if you experience slow output or dropped executions under load.

What is the difference between SQLite and PostgreSQL for a self-hosted n8n instance?

SQLite is the default database and works fine for smaller setups, but PostgreSQL is recommended if you plan to run many workflows, enable queue mode, or need greater reliability and data integrity at scale.

Handling Webhook Traffic at Scale in n8n

N8n webhook scaling breaks down faster than you'd expect. When request volumes spike, concurrency pressure builds, and executions start backin...
8 min read
Christi Gorbett
Christi Gorbett
Content Marketing Specialist

Running n8n in Production - Stability Checklist

Getting workflows live is only half the battle. n8n production stability is what keeps your automations running reliably when it actually matt...
8 min read
Christi Gorbett
Christi Gorbett
Content Marketing Specialist

CI/CD Pipelines for Deploying n8n Updates

Manually pushing n8n updates across environments is error-prone and time-consuming. A well-configured n8n CI/CD pipeline changes that. It auto...
8 min read
Christi Gorbett
Christi Gorbett
Content Marketing Specialist

Running n8n with Docker Compose vs Bare-Metal VPS

Choosing between n8n Docker Compose vs bare metal VPS comes down to more than personal preference. It affects how you deploy, scale, and maint...
8 min read
Christi Gorbett
Christi Gorbett
Content Marketing Specialist
Click to go to the top of the page
Go To Top
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.