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.
Start from the official requirements
- Dify · Docker ComposeOfficial minimum: 2 CPU cores / 4 GiB RAM
- 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.


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.



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.
| Plan | vCPU | RAM | Price | Per month | Locations outside AI API lists |
|---|---|---|---|---|---|
| Contabo Cloud VPS 4 | 4 | 8 GB | $6.60/mo | $6.60 | None |
| DigitalOcean Droplets Basic Regular 4 GiB / 2 vCPUs | 2 | 4 GB | $24/mo | $24 | None |
| Akamai Linode Linode 4GB | 2 | 4 GB | $24/mo | $24 | None |
| RackNerd KVM VPS 4 GB | 4 | 4 GB | $24.59/mo | $24.59 | None |
| RackNerd KVM VPS 6 GB | 5 | 6 GB | $27.59/mo | $27.59 | None |
| RackNerd KVM VPS 8 GB | 6 | 8 GB | $36.59/mo | $36.59 | None |
| RackNerd KVM VPS 12 GB | 7 | 12 GB | $55.99/mo | $55.99 | None |
| BandwagonHost (搬瓦工) Basic VPS 80G KVM (promo) | 4 | 4 GB | $199.99/yr | $16.67 | Hong Kong |
| BandwagonHost (搬瓦工) Basic VPS 160G KVM (promo) | 5 | 8 GB | $399.99/yr | $33.33 | Hong Kong |
| BandwagonHost (搬瓦工) CN2 GIA E-Commerce 80G KVM (promo V5) | 4 | 4 GB | $549.99/yr | $45.83 | Hong Kong |
| BandwagonHost (搬瓦工) CN2 GIA E-Commerce SLA Los Angeles 80G KVM | 4 | 4.04 GB | $699.99/yr | $58.33 | Hong Kong |
| BandwagonHost (搬瓦工) Basic VPS 320G KVM (promo) | 6 | 16 GB | $799.99/yr | $66.67 | Hong 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.
Related services
Listing order is not a recommendation or quality ranking. Confirm plans and terms on the official sites.