VPS & Cloud Servers

Choosing a VPS for Dify, n8n or an AI agent: specs, location and monthly cost

Size the server from the official requirements, pick a location that the AI APIs you call officially support, and budget the server and the API bill separately.

5 sections · 5 official screenshots

Start from the official requirements

Size the server for the application
  1. Dify · Docker ComposeOfficial minimum: 2 CPU cores / 4 GiB RAM
  2. n8nNo fixed official minimum; memory depends on workflow data

Test real runs and monitor memory. Choose an AI-supported location and budget the server and model API separately.

Dify’s self-hosting guide (Docker Compose) lists a minimum of 2 CPU cores and 4 GiB of RAM. That rules out most 512 MB–2 GB promo plans before price is even considered. The table below lists plans that meet 2 vCPU / 4 GB, sorted by monthly-equivalent price.

n8n does not publish a fixed minimum. Its docs explain that memory use depends on how much data each workflow execution handles, and that large files, binary data and some nodes can exhaust memory. Our suggestion (not an official figure): start small for light scheduled workflows, watch memory during real runs, and move up a plan if you see out-of-memory errors.

Dify documentation for Docker Compose deployment stating the minimum requirement of 2 CPU cores and 4 GiB RAM.
Screenshot of Dify (2026-10-18). Check the official page for current prices and terms. Open the official page ↗
Dify documentation for Docker Compose deployment stating the minimum requirement of 2 CPU cores and 4 GiB RAM.
n8n documentation explaining that memory use depends on the data each workflow execution handles and how to fix out-of-memory errors.
Screenshot of n8n (2026-10-18). Check the official page for current prices and terms. Open the official page ↗
n8n documentation explaining that memory use depends on the data each workflow execution handles and how to fix out-of-memory errors.

Pick a location the AI APIs support

If the server calls OpenAI, Claude or Gemini directly, the datacenter country matters. Hong Kong, mainland China and Macau are not on the official supported-region lists of any of the three. Locations such as the United States, Japan, Singapore and most of Europe are on all three lists.

If you mainly call Chinese model APIs such as DeepSeek or Qwen, check those providers’ own terms instead; their rules are independent of the three lists above. Each VPS page shows which of its locations fall outside the lists.

OpenAI documentation page listing the countries and territories where the API is officially supported.
Screenshot of OpenAI (2026-10-18). Check the official page for current prices and terms. Open the official page ↗
OpenAI documentation page listing the countries and territories where the API is officially supported.
Anthropic legal page listing the regions where its services are officially supported.
Screenshot of Anthropic (2026-10-18). Check the official page for current prices and terms. Open the official page ↗
Anthropic legal page listing the regions where its services are officially supported.
Gemini API documentation listing the countries and regions where the API is available.
Screenshot of Google AI (2026-10-18). Check the official page for current prices and terms. Open the official page ↗
Gemini API documentation listing the countries and regions where the API is available.

Routes: who connects to the server?

Outbound API calls from a US or Japan server travel over the provider’s international network, so a China-optimized route such as CN2 GIA does not make those calls faster. A premium route mainly helps when people in mainland China open the app’s web UI or webhooks every day.

A common split is a cheap standard-route server for the app and workers, and no premium route unless mainland users complain about the UI. Compare the route column on the CN2 GIA page before paying several times more.

Budget two bills, not one

Self-hosting removes the platform subscription, not the model bill. Estimate the API cost per month from your expected requests and tokens with the calculator, then add the server. For many small projects the API bill is the larger number.

Read the refund column before buying: several low-cost providers refund nothing by default, and others have a 3-day window. Test the deployment on the cheapest plan that meets the official minimum, then decide on a longer billing period.

Keep keys and data safe

Store API keys in environment variables or the app’s credential store, not in workflow exports. Put the admin UI behind HTTPS and a strong password, keep the OS and containers updated, and back up the database and volumes to another location.

Set a spending limit on each AI API account where the provider offers one, so a looping workflow cannot run up an unexpected bill.

Plans with at least 2 vCPU / 4 GB

Filtered from plans we checked against official sites: plans whose locations are all on the AI API supported-region lists come first, unconfirmed ones next, and plans with unsupported locations (e.g. Hong Kong) last, sorted by monthly-equivalent price within each group. Official list prices on the date we checked, not live quotes.

PlanvCPURAMPricePer monthLocations outside AI API lists
Contabo
Cloud VPS 4
48 GB$6.60/mo$6.60None
DigitalOcean Droplets
Basic Regular 4 GiB / 2 vCPUs
24 GB$24/mo$24None
Akamai Linode
Linode 4GB
24 GB$24/mo$24None
RackNerd
KVM VPS 4 GB
44 GB$24.59/mo$24.59None
RackNerd
KVM VPS 6 GB
56 GB$27.59/mo$27.59None
RackNerd
KVM VPS 8 GB
68 GB$36.59/mo$36.59None
RackNerd
KVM VPS 12 GB
712 GB$55.99/mo$55.99None
BandwagonHost (搬瓦工)
Basic VPS 80G KVM (promo)
44 GB$199.99/yr$16.67Hong Kong
BandwagonHost (搬瓦工)
Basic VPS 160G KVM (promo)
58 GB$399.99/yr$33.33Hong Kong
BandwagonHost (搬瓦工)
CN2 GIA E-Commerce 80G KVM (promo V5)
44 GB$549.99/yr$45.83Hong Kong
BandwagonHost (搬瓦工)
CN2 GIA E-Commerce SLA Los Angeles 80G KVM
44.04 GB$699.99/yr$58.33Hong Kong
BandwagonHost (搬瓦工)
Basic VPS 320G KVM (promo)
616 GB$799.99/yr$66.67Hong Kong

Your next steps

  • Meet the official minimum (Dify: 2 CPU / 4 GiB).
  • Choose a location on the AI API supported lists.
  • Budget the API bill separately from the server.
  • Check refund terms and back up data.

Calculate API costs →

Related services

Listing order is not a recommendation or quality ranking. Confirm plans and terms on the official sites.

VPS & Cloud Servers →

Official pricing and terms to check

How we check prices and ordering →