---
title: "Self-Host Dify.AI on a VPS: Install & Production Guide"
description: "Install Dify.AI on a VPS in 20 minutes: Docker setup, SSL, Ollama for local models, and backups. From $21.24/mo vs. $59/mo on Dify Cloud. Full commands included."
image: https://blog.ishosting.com/hubfs/blog/self-hosted-dify/self-hosted-dify.png
---

<https://ishosting.com/en>

[VPS](https://ishosting.com/en/vps) [Dedicated hosting](https://ishosting.com/en/dedicated) [VPN](https://ishosting.com/en/vpn) [Storage](https://ishosting.com/en/storage) [About us](https://ishosting.com/en/about)

[Client area](https://my.ishosting.com/en/account)

[is\*hosting Blog](https://blog.ishosting.com/en)

- [News](https://blog.ishosting.com/en/tag/news)
- [VPS](https://blog.ishosting.com/en/tag/vps)
- [Hosting](https://blog.ishosting.com/en/tag/hosting)
- [Technology](https://blog.ishosting.com/en/tag/technology)
- [is\*ai](https://blog.ishosting.com/en/tag/isai)
- Other 
    - [Marketing](https://blog.ishosting.com/en/tag/marketing)
    - [Security](https://blog.ishosting.com/en/tag/security)

[News](https://blog.ishosting.com/en/tag/news)

 Categories

[Search](https://blog.ishosting.com/hs-search-results)

 Hosting Services

[About Us](https://ishosting.com/en/about)

[Client Area](https://my.ishosting.com/en/account)

[News](https://blog.ishosting.com/en/tag/news) [VPS](https://blog.ishosting.com/en/tag/vps) [Hosting](https://blog.ishosting.com/en/tag/hosting) [Technology](https://blog.ishosting.com/en/tag/technology) [is\*ai](https://blog.ishosting.com/en/tag/isai) [Marketing](https://blog.ishosting.com/en/tag/marketing) [Security](https://blog.ishosting.com/en/tag/security)

[VPS](https://ishosting.com/en/vps) [Dedicated hosting](https://ishosting.com/en/dedicated) [VPN](https://ishosting.com/en/vpn) [Storage](https://ishosting.com/en/storage)

1. [Blog](https://blog.ishosting.com/en)
2. [Technology](https://blog.ishosting.com/en/tag/technology)
3. How to Self-Host Your AI Workflow Platform: Dify.AI on a VPS

Technology

# How to Self-Host Your AI Workflow Platform: Dify.AI on a VPS

Install Dify.AI on a VPS in 20 minutes: Docker setup, SSL, Ollama for local models, and backups. From $21.24/mo vs. $59/mo on Dify Cloud. Full commands included.

[is\*hosting team](https://blog.ishosting.com/en/author/team-ishosting) 14 May 2026 9 min reading

![How to Self-Host Your AI Workflow Platform: Dify.AI on a VPS](https://blog.ishosting.com/hubfs/blog/self-hosted-dify/self-hosted-dify.png)

Table of Contents

- [What You Need Before You Start](https://blog.ishosting.com/en/self-hosted-dify#what-you-need)
- [Install Dify.AI on a VPS](https://blog.ishosting.com/en/self-hosted-dify#install-dify)
- [Production Setup](https://blog.ishosting.com/en/self-hosted-dify#production-setup)
- [Build Your First AI Workflow](https://blog.ishosting.com/en/self-hosted-dify#first-ai-workflow)
- [Dify Cloud vs. Self-Hosted: The Numbers](https://blog.ishosting.com/en/self-hosted-dify#cloud-vs-self-hosted)
- [Troubleshooting](https://blog.ishosting.com/en/self-hosted-dify#troubleshooting)
- [Next Steps](https://blog.ishosting.com/en/self-hosted-dify#next-steps)

Dify Cloud Professional costs **$59/month**: run limits, credit quotas, and data on their servers. For **$21.24-$50.99** on a VPS, you get a self-hosted AI instance on a KVM server that you control via SSH.

This guide covers installation, production hardening (SSL, secrets, backups), and your first AI workflow. On a clean server, setup takes 20-30 minutes.

## What You Need Before You Start

Pick the plan that matches your workload:

For Dify with external APIs only (OpenAI, Anthropic). Sufficient for the core Dify stack, but cannot run local AI models:

- [Medium VPS](https://ishosting.com/en/vps/158_1y?city=us-dallas)
- From $21.24/mo, with annual billing
- **Specs:** 3 CPU / 4 GB RAM / 40 GB NVMe

For entry-level local AI. Runs Dify combined with lightweight Ollama models (3B-4B) like Qwen or Phi-3.

- [Premium VPS](https://ishosting.com/en/vps/159_1y?city=us-dallas)
- From $33.99/mo, with annual billing
- **Specs:** 4 CPU / 8 GB RAM / 50 GB NVMe

For complete local AI. Runs Dify combined with larger local models up to 13B, like Llama 3 or Qwen.

- [Elite VPS](https://ishosting.com/en/vps/160_1y?city=us-dallas)
- From $50.99/mo, with annual billing
- **Specs:** 6 CPU / 16 GB RAM / 80 GB NVMe

### Other requirements

- Ubuntu 24.04 LTS. Check if Docker is already installed: docker --version — if it returns a version, skip the install step below.
- [SSH access to your VPS](https://blog.ishosting.com/en/how-to-ssh-to-a-server)
- A domain name is optional, but required for HTTPS
- An API key from your model provider, or Ollama for local inference

## Install Dify.AI on a VPS

Everything here is copy-paste ready. Placeholders are in ALL\_CAPS. This is the full [Dify](https://github.com/langgenius/dify) self-hosted guide for Ubuntu, from a blank server to a working Dify.AI dashboard.

### Step 1. Prepare the Server

Connect and update:

```
# Connect
ssh root@YOUR_SERVER_IP

# Update the system
apt update && apt upgrade -y

# Open the ports Dify needs
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
```

![UFW firewall setup on a VPS](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/1.png?width=786&height=272&name=1.png)

*This keeps SSH open and exposes only HTTP/HTTPS. Everything else is blocked by default, except ports published by Docker: they bypass UFW, so we close them in Production Setup.*

If Docker is not installed:

```
curl -fsSL https://get.docker.com | sh

docker compose version
```

![Docker Compose version output](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/2.png?width=657&height=98&name=2.png)

*The second command confirms Docker Compose is available. If it returns an error, install it separately: `apt install docker-compose-plugin -y`*

### Step 2. Install Dify

```
# Clone the repository
git clone https://github.com/langgenius/dify.git

# Go to the Docker directory
cd dify/docker

# Create your config file
cp .env.example .env

# Generate the required sandbox token
sed -i "s/^DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN=.*/DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN=$(openssl rand -hex 32)/" .env

# Replace the default database and Redis passwords before the first start
echo "DB_PASSWORD=$(openssl rand -hex 32)" >> .env
echo "REDIS_PASSWORD=$(openssl rand -hex 32)" >> .env

# If your VPS runs a control panel (Ispmanager, Hestia, etc.),
# ports 80 and 443 are already taken. Reassign Dify's ports now:
echo 'EXPOSE_NGINX_PORT=8090' >> .env
echo 'EXPOSE_NGINX_SSL_PORT=8443' >> .env

# Start all services
docker compose up -d
```

![Cloning Dify repository from GitHub](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/3.png?width=786&height=141&name=3.png)

*Since Dify 1.19.0, .env.example contains only the required settings: the sandbox token and the service profiles. Ports and passwords are added as separate lines, and the last line with the same name wins. The first run pulls all Docker images (~2-4 GB). Expect 3-5 minutes on a 1 Gbps uplink.*

![Docker compose up output showing all Dify containers started](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/4.png?width=786&height=183&name=4.png)

Verify the stack is up:

```
docker compose ps
```

 

All containers should show the status "running". If any show "exited," run: `docker compose logs SERVICE_NAME`

![Docker compose ps output showing all Dify containers running](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/5.png?width=786&height=309&name=5.png)

### Step 3. First Login

Go to `http://YOUR_SERVER_IP:8090` (or port 80 if you skipped the port change step). The setup wizard will open.

![Dify setup wizard — creating an admin account](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/6.png?width=786&height=417&name=6.png)

- Create your admin account.
- Go to **Settings**, then **Model Provider**, and add your first AI model.
- Paste your API key (OpenAI, Anthropic, Gemini, or any supported provider). Dify verifies the connection immediately.
- The dashboard is ready. You can now build workflows.

![Dify Studio dashboard — ready to create apps](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/7.png?width=786&height=405&name=7.png)

![Dify Settings — Model Provider page with available AI providers](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/8.png?width=786&height=485&name=8.png)

### Step 4 (Optional). Add Ollama for Local Models

*Skip this step if you're on Medium — it doesn't have enough RAM for local models. The instructions below assume Premium (8 GB) or higher. On Premium, lightweight models (3B-4B) like Qwen or Phi-3 run comfortably. For 7B+ models, use Elite (16 GB).*

Ollama lets you run models like Llama, Qwen, and Gemma on the same server as Dify.

```
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull a model (llama3 is an 8B model, ~4.7 GB: use Elite.
# On Premium, pull a 3B model instead, e.g. qwen2.5:3b)
ollama pull llama3

# Confirm it loaded
ollama list
```

![Ollama installation output on a VPS](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/9.png?width=786&height=166&name=9.png)

![Ollama pull llama3 and ollama list output](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/10.png?width=595&height=311&name=10.png)

The model downloads to `/usr/share/ollama/.ollama/models` by default. Check available disk space first with: `df -h`

### Fix Ollama Network Error

Two things block the connection: Ollama only listens on localhost (so Docker can't reach it), and UFW blocks port 11434.

Fix — expose Ollama to all interfaces via systemd override:

```
mkdir -p /etc/systemd/system/ollama.service.d

echo '[Service]' > /etc/systemd/system/ollama.service.d/environment.conf
echo 'Environment="OLLAMA_HOST=0.0.0.0"' >> /etc/systemd/system/ollama.service.d/environment.conf

systemctl daemon-reload
systemctl restart ollama
```

Ollama now listens on all interfaces. The override persists across reboots.

Then open the port in UFW:

```
# Allow Ollama access only from Docker networks (not the public internet).
# 172.16.0.0/12 covers the default bridge (172.17.x.x) and the Compose
# network Dify runs in (172.18.x.x and up).
ufw allow from 172.16.0.0/12 to any port 11434

# Ollama has no built-in authentication.
# Do NOT use 'ufw allow 11434/tcp' — that exposes your models to anyone.
```

### Connect Ollama to Dify

Find your Docker bridge gateway IP:

```
ip route | grep docker | awk '{print $9}'
# Typically returns: 172.17.0.1
```

![Docker bridge gateway IP output — 172.17.0.1](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/11.png?width=625&height=76&name=11.png)

Using the bridge IP keeps traffic inside the host. If it fails, use `http://YOUR_SERVER_IP:11434` instead.

Go to **Settings** → **Model Provider**, scroll to **Ollama**, and click **Add Model**. Fill in:

![Dify Model Provider — searching and installing Ollama](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/12.png?width=786&height=392&name=12.png)

![Ollama installed in Dify — Add Model button](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/13.png?width=786&height=165&name=13.png)

- **Model Name:** llama3
- **Base URL:** http://172.17.0.1:11434 (the Docker bridge IP from the terminal above)
- **Model Type:** LLM (default, leave as is)
- **Authorization Name:** Leave blank
- **Completion mode:** Chat (default)
- **Model context size:** 8192
- **Upper bound for max tokens:** 4096
- **Vision support:** No
- **Function call support:** No

![Dify Add Model form for Ollama](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/14.png?width=786&height=763&name=14.png)

Click **Save**. A green **Active** badge will appear next to Ollama, confirming the connection.

If the badge doesn't appear, confirm you ran both fix steps above: the systemd override and `ufw allow from 172.16.0.0/12 to any port 11434`. Then try saving again.

## Production Setup

![self-hosted AI](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/01_en.png?width=1536&height=704&name=01_en.png)

A self-hosted AI instance on port 8090 over plain HTTP is a test environment. Before it handles real AI workflow traffic, add SSL, hardened secrets, and backups.

### Reverse Proxy and SSL

Confirm Dify is running on port 8090 (we set this in Step 2):

```
cd ~/dify/docker

# Verify the port is already set from Step 2:
grep EXPOSE_NGINX_PORT .env
# Should return: EXPOSE_NGINX_PORT=8090

# If it returns nothing, add the ports now:
echo 'EXPOSE_NGINX_PORT=8090' >> .env
echo 'EXPOSE_NGINX_SSL_PORT=8443' >> .env
docker compose up -d
```

After this, Dify runs on port 8090 internally. Your system Nginx will proxy from 80/443 to 8090.

Now install Nginx and Certbot:

```
apt install nginx certbot python3-certbot-nginx -y
```

Create the Nginx config:

```
nano /etc/nginx/sites-available/dify
```

Paste this server block:

```
server {
    listen 80;
    server_name YOUR_DOMAIN;

    location / {
        proxy_pass         http://127.0.0.1:8090;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_buffering    off;
        proxy_read_timeout 3600s;
        client_max_body_size 100M;
    }
}
```

`proxy_http_version 1.1` and the `Upgrade` and `Connection` headers pass WebSocket connections, which Dify's real-time collaboration service uses by default. `proxy_read_timeout 3600s` handles long AI inference requests. `client_max_body_size 100M` lets you upload large documents to the knowledge base.

```
# Enable the site
ln -s /etc/nginx/sites-available/dify /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx

# Get a free SSL certificate
certbot --nginx -d YOUR_DOMAIN
```

Certbot configures Nginx for HTTPS automatically and sets up auto-renewal. After this, Dify is at https://YOUR\_DOMAIN

### Secrets

Dify uses three secrets: the database password, the Redis password, and SECRET\_KEY. Dify generates SECRET\_KEY on the first start and keeps it in volumes/app/storage/.dify\_secret\_key, so you don't need to set it. You set the two passwords in Step 2. Check them before connecting any real data:

```
cd ~/dify/docker

# Both lines should show your own 64-character values
grep -E '^(DB_PASSWORD|REDIS_PASSWORD)=' .env
```

If the command returns nothing, Dify is running with the default passwords. PostgreSQL sets its password only when it creates the database, so a new value in .env alone locks Dify out of it. Change the password inside PostgreSQL first, then save it in .env:

```
NEW_DB_PASSWORD=$(openssl rand -hex 32)
docker compose exec db_postgres psql -U postgres -c "ALTER USER postgres PASSWORD '$NEW_DB_PASSWORD';"
echo "DB_PASSWORD=$NEW_DB_PASSWORD" >> .env
echo "REDIS_PASSWORD=$(openssl rand -hex 32)" >> .env
docker compose up -d
```

Now close Dify's internal ports. UFW can't do it: Docker adds its own iptables rules for published ports that bypass UFW, so ufw deny 8090/tcp leaves Dify open at http://YOUR\_SERVER\_IP:8090. The plugin daemon also publishes its remote debugging port 5003 on all interfaces. Publish all three ports on localhost only instead (Docker Compose reads docker-compose.override.yaml automatically):

```
# Make Dify reachable only through your system Nginx
sed -i 's/^EXPOSE_NGINX_PORT=.*/EXPOSE_NGINX_PORT=127.0.0.1:8090/' .env
sed -i 's/^EXPOSE_NGINX_SSL_PORT=.*/EXPOSE_NGINX_SSL_PORT=127.0.0.1:8443/' .env

# Keep the plugin debugging port on localhost too
cat > docker-compose.override.yaml <<'EOF'
services:
  plugin_daemon:
    ports: !override
      - "127.0.0.1:5003:5003"
EOF

docker compose up -d
```

### Backups

is\*hosting runs weekly infrastructure backups, which cover the server itself. **Dify's application data** — workflows, knowledge bases, uploaded documents, and vector embeddings — lives in the dify/docker/volumes/ directory. Back that up separately.

```
#!/bin/bash
# Dify backup script
# Save as /home/backup_dify.sh
# chmod +x /home/backup_dify.sh

DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/home/dify_backups"
DIFY_DIR="/root/dify/docker"

mkdir -p $BACKUP_DIR

# Stop Dify so the database files are consistent
cd $DIFY_DIR && docker compose stop

# Back up the volumes directory and .env (it holds the DB password)
tar czf $BACKUP_DIR/dify_volumes_$DATE.tar.gz \
  -C $DIFY_DIR volumes/ .env

# Start Dify again
docker compose start

echo "Backup done: dify_volumes_$DATE.tar.gz"
```

Backs up the full volumes/ directory (DB, file storage, and vector store) and .env, which holds the database password. Dify is stopped while the archive is created: a copy of a running PostgreSQL data directory may not restore. DB-only backups will not restore knowledge base files on recovery.

```
# Schedule daily backups at 2 AM
crontab -e

# Add this line:
0 2 * * * /bin/bash /home/backup_dify.sh >> /var/log/dify_backup.log 2>&1
```

## Build Your First AI Workflow

![AI workflow to build with Dify.AI](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/02_en.png?width=1536&height=704&name=02_en.png)

The most useful first AI workflow to build with [Dify.AI](http://dify.ai) is a RAG chatbot that answers from your documents, not its training data. This is how you build your own generative AI chatbot that knows your product.

### Create a Knowledge Base

- Go to **Knowledge** → **Create Knowledge**.
- Upload your documents: PDF, DOCX, TXT, or Markdown.
- Pick an embedding model. OpenAI text-embedding-3-small works for most cases.
- Wait for indexing to finish. The dashboard shows chunk count and status.

### Build the Chatflow

- Go to **Studio** → **Create App** → **Chatflow**.
- Add a **Knowledge Retrieval** node and connect it to your knowledge base.
- Add an **LLM** node after it; this is where the model generates the response.
- Set the system prompt:

![Dify Studio — Create from Blank](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/15.png?width=786&height=413&name=15.png)

![Dify Create from Blank — selecting Chatflow app type](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/16.png?width=786&height=329&name=16.png)

```
Answer questions based ONLY on the context below.
If the answer is not in the context, say so.
Do not make things up.

Context: {{#context#}}
Question: {{#sys.query#}}
```

{{#context#}} is automatically replaced with retrieved chunks from your knowledge base. This keeps answers grounded in your actual documents.

### Publish

- Click **Publish**. Dify gives you an embeddable chat widget and a REST API endpoint.
- Embed the widget on your site or call the API from your app.
- Your documents are now queryable by anyone you give access to — all running on your own VPS.

![Dify Chatflow editor with LLM node and publish options](https://blog.ishosting.com/hs-fs/hubfs/blog/self-hosted-dify/17.png?width=786&height=400&name=17.png)

## Dify Cloud vs. Self-Hosted: The Numbers

| **Criteria** | **Dify Cloud (Professional)** | **Self-hosted on is\*hosting** |
| --- | --- | --- |
| Monthly cost | $59/mo ($49/mo annual) | From $21.24/mo (annual billing) |
| Workflow run limits | Platform quotas apply | No platform-imposed quotas |
| Message credits | Limited per plan | No credit system |
| Your data | Stored on Dify's servers | Your VPS, your jurisdiction |
| Local models | Not supported | Yes, via Ollama |
| API key routing | Through Dify's platform | Direct to your provider |
| Customization | Limited by SaaS constraints | Full access (open source) |
| SSL | Included | Free via Let's Encrypt |

The cost gap is **$8-38/mo, depending on the plan**. Add Ollama and the savings compound: one-time compute cost, no per-token fees, no platform quotas on your AI workflow.

The real argument for self-hosting is data residency. As an open-source LLMOps platform, Dify gives you full control: customer data, legal docs, and compliance requirements stay on your server, not Dify's.

###### VPS

KVM-powered VPS with NVMe storage in 40+ locations. Full root access, dedicated resources, and up to 256 IPv4 addresses per plan.

[Compare VPS plans](https://ishosting.com/en/vps)

## Troubleshooting

Five issues most people run into the first time they run Dify.AI on a VPS:

### Dify Won't Start

Check the logs for the service that failed:

```
docker compose logs --tail=50 api
```

Two causes cover most cases: RAM below 4 GB, or a port conflict.

**Port conflict error:** `failed to bind host port 0.0.0.0:80/tcp` or `443/tcp: address already in use`

A system web server or control panel (Ispmanager, Hestia) owns those ports. Don't stop it; shift Dify's ports instead:

```
docker compose down
echo 'EXPOSE_NGINX_PORT=8090' >> .env
echo 'EXPOSE_NGINX_SSL_PORT=8443' >> .env
docker compose up -d
```

After this, Dify runs on port 8090. Check with: `docker compose ps`

### Ollama Network Error in Dify

Dify can't reach Ollama. Two things cause this:

- **Ollama only listens on localhost** by default; Docker containers can't reach it.
- **UFW blocks port 11434**, so the connection never gets through.

Fix both:

```
# Step 1 - expose Ollama to all interfaces
mkdir -p /etc/systemd/system/ollama.service.d
echo '[Service]' > /etc/systemd/system/ollama.service.d/environment.conf
echo 'Environment="OLLAMA_HOST=0.0.0.0"' >> /etc/systemd/system/ollama.service.d/environment.conf
systemctl daemon-reload
systemctl restart ollama

# Step 2 - open the port for Docker networks only
ufw allow from 172.16.0.0/12 to any port 11434
```

If the Docker bridge IP (172.17.0.1) still fails in Dify after this, use your public server IP instead: `http://YOUR_SERVER_IP:11434`

### Models Not Connecting

Test outbound connectivity from the VPS, then check the worker logs:

```
curl -I https://api.openai.com

docker compose logs --tail=30 worker
```

Some providers block outbound traffic to certain IP ranges by default. If curl returns nothing, check your firewall and VPS provider network settings.

### Slow Performance

Check live resource usage across containers:

```
docker stats --no-stream
```

Consistent high memory on the API or worker container means RAM is the bottleneck. **Medium (4 GB)** handles API models fine. **Dify + Ollama** with 3B-4B models fits in 8 GB (Premium); 7B-13B models need 16 GB (Elite).

### 502 Bad Gateway

Nginx is up, but it can't reach Dify. Verify the backend is running, and the proxy target is correct:

```
# Check which port Dify is actually on
docker compose ps

# Test direct connection
curl -I http://127.0.0.1:8090
```

If the direct connection works but Nginx returns 502, the proxy\_pass in your Nginx config points to the wrong port. Match it to the port shown in docker compose ps output.

## Next Steps

**Medium (4 GB RAM)** runs **Dify.AI** with API models comfortably — the core stack stays under 3 GB. For Ollama, start with **Premium (8 GB)** for lightweight models (3B-4B), or **Elite (16 GB)** for 7B-13B models.

All plans include **KVM, NVMe storage, and 40+ locations**. The full self-hosted AI starter kit from this guide works on any of them — the difference is how many models you can run locally.

Start with the Premium plan for local AI workflows, or [compare all VPS plans](https://ishosting.com/en/vps).

{{ include\_custom\_fonts({"Whitney":\["Bold","Bold Italic","Light","Light Italic","Medium","Medium Italic","Regular","Semi Bold","Semi Bold Italic"\]}) }}

###### Dedicated Server

When VPS is not enough.

[From $63.75/mo](https://ishosting.com/en/dedicated)

Table of Contents

- [What You Need Before You Start](https://blog.ishosting.com/en/self-hosted-dify#what-you-need)
- [Install Dify.AI on a VPS](https://blog.ishosting.com/en/self-hosted-dify#install-dify)
- [Production Setup](https://blog.ishosting.com/en/self-hosted-dify#production-setup)
- [Build Your First AI Workflow](https://blog.ishosting.com/en/self-hosted-dify#first-ai-workflow)
- [Dify Cloud vs. Self-Hosted: The Numbers](https://blog.ishosting.com/en/self-hosted-dify#cloud-vs-self-hosted)
- [Troubleshooting](https://blog.ishosting.com/en/self-hosted-dify#troubleshooting)
- [Next Steps](https://blog.ishosting.com/en/self-hosted-dify#next-steps)

<http://www.facebook.com/share.php?u=https%3A%2F%2Fblog.ishosting.com%2Fen%2Fself-hosted-dify%3Futm_medium%3Dsocial%26utm_source%3Dfacebook> <https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fblog.ishosting.com%2Fen%2Fself-hosted-dify%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&url=https%3A%2F%2Fblog.ishosting.com%2Fen%2Fself-hosted-dify%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&source=tweetbutton&text=> <http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fblog.ishosting.com%2Fen%2Fself-hosted-dify%3Futm_medium%3Dsocial%26utm_source%3Dlinkedin> <http://pinterest.com/pin/create/button/?url=https%3A%2F%2Fblog.ishosting.com%2Fen%2Fself-hosted-dify%3Futm_medium%3Dsocial%26utm_source%3Dpinterest&media=https%3A%2F%2F25913237.fs1.hubspotusercontent-eu1.net%2Fhubfs%2F25913237%2Fblog%2Fself-hosted-dify%2Fself-hosted-dify.png&description=Install%20Dify.AI%20on%20a%20VPS%20in%2020%20minutes:%20Docker%20setup,%20SSL,%20Ollama%20for%20local%20models,%20and%20backups.%20From%20$21.24/mo%20vs.%20$59/mo%20on%20Dify%20Cloud.%20Full%20commands%20included.>

## Related articles

![Odysseus on VPS: How to Self-Host Your AI Workspace](https://blog.ishosting.com/hubfs/blog/odysseus-on-vps/odysseus-on-vps.png)

Hosting

### Odysseus on VPS: How to Self-Host Your AI Workspace

A step-by-step guide to self-hosting the Odysseus AI workspace on a VPS. Set up Docker, model providers, agent mode,...

is\*hosting team 17 Jun 2026 7 min reading 

<https://blog.ishosting.com/en/odysseus-on-vps>

![Clawdbot with Docker and Ollama: Self-Hosted AI Stack Guide](https://blog.ishosting.com/hubfs/blog/clawdbot-with-docker-and-ollama-on-vps/clawdbot-with-docker-and-ollama-on-vps.png)

How to

### Clawdbot with Docker and Ollama: Self-Hosted AI Stack Guide

Build your own private AI stack on a VPS! Learn how to deploy Clawdbot with Docker and Ollama in this complete,...

is\*hosting team 4 Jun 2026 8 min reading 

<https://blog.ishosting.com/en/clawdbot-with-docker-and-ollama-on-vps>

![Obsidian on VPS: Self-Hosted Sync Without the Subscription](https://blog.ishosting.com/hubfs/blog/obsidian-on-vps/obsidian-on-vps.png)

Hosting

### Obsidian on VPS: Self-Hosted Sync Without the Subscription

Want free, private note syncing? Learn how to install and configure a self-hosted Obsidian sync server on a VPS to...

is\*hosting team 28 Jul 2026 9 min reading 

<https://blog.ishosting.com/en/obsidian-on-vps>

## Subscribe to Newsletter

The latest news, profitable discounts, and informative articles - subscribe to the is\*hosting blog and be the first to receive a useful newsletter.

- **Services**
  
  Services

    - [Virtual Private Servers](https://ishosting.com/en/vps)
    - [Dedicated Servers](https://ishosting.com/en/dedicated)
    - [Storage](https://ishosting.com/en/storage)
    - [VPN](https://ishosting.com/en/vpn)
    - [Special Offers](https://ishosting.com/en/special-offers)
- ---
- **Company**
  
  Company

    - [About Us](https://ishosting.com/en/about)
    - [Data Centers](https://ishosting.com/en/datacenters)
    - [Blog](https://blog.ishosting.com/en)
    - [Contacts](https://ishosting.com/en/about#offices)
- ---
- **Information**
  
  Information

    - [Knowledge Base](https://help.ishosting.com/en)
    - [Support](https://ishosting.com/en/support)
    - [Payments Methods](https://ishosting.com/en/payment-methods)
- ---
- **Account**
  
  Account

    - [Create Account](https://my.ishosting.com/en/register)

---

<https://ishosting.com> © 2026

 WEBRAIN OÜ, Harju maakond, Tallinn, Kesklinna linnaosa, Endla tn 4, 10142

<https://www.facebook.com/ishostingcom> <https://twitter.com/ishostingcom> <https://www.instagram.com/is.hosting> <https://www.linkedin.com/company/is-hosting> <https://www.youtube.com/@ishosting> <https://www.pinterest.com/ishostingcom>

- [![](https://blog.ishosting.com/hs-fs/hubfs/raw_assets/public/ishosting-theme/images/rating-sm.png?width=328&height=70&name=rating-sm.png) ![](https://blog.ishosting.com/hs-fs/hubfs/raw_assets/public/ishosting-theme/images/rating.png?width=421&height=70&name=rating.png)](https://hostadvice.com/hosting-company/ishosting-reviews/#main-info)

---

- [Terms of Use](https://ishosting.com/en/terms-of-use)
- [Privacy Policy](https://ishosting.com/en/privacy-policy)
- [KYC Policy](https://ishosting.com/en/kyc-policy)
- [SLA](https://ishosting.com/en/service-level-agreement)
- [AUP](https://ishosting.com/en/acceptable-use-policy)
- en
  
    - [en](https://blog.ishosting.com/en)
    - [ru](https://blog.ishosting.com/ru/self-hosted-dify)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "abstract" : "Install Dify.AI on a VPS in 20 minutes: Docker setup, SSL, Ollama for local models, and backups. From $21.24/mo vs. $59/mo on Dify Cloud. Full commands included.",
  "alternativeHeadline" : "Self-Host Dify.AI on a VPS: Install &amp; Production Guide",
  "articleSection" : "Technology",
  "author" : {
    "@type" : "Organization",
    "name" : "is*hosting team",
    "sameAs" : [ "https://www.linkedin.com/company/is-hosting", "https://twitter.com/ishostingcom", "https://www.instagram.com/is.hosting" ],
    "url" : "https://blog.ishosting.com/en/author/team-ishosting"
  },
  "dateModified" : "2026-11-26T10:52:38.000Z",
  "datePublished" : "2026-05-14T08:00:00.000Z",
  "description" : "Install Dify.AI on a VPS in 20 minutes: Docker setup, SSL, Ollama for local models, and backups. From $21.24/mo vs. $59/mo on Dify Cloud. Full commands included.",
  "headline" : "How to Self-Host Your AI Workflow Platform: Dify.AI on a VPS",
  "image" : [ {
    "@type" : "ImageObject",
    "height" : 1348,
    "name" : "How to Self-Host Your AI Workflow Platform: Dify.AI on a VPS",
    "url" : "https://25913237.fs1.hubspotusercontent-eu1.net/hubfs/25913237/blog/self-hosted-dify/self-hosted-dify.png",
    "width" : 2396
  } ],
  "inLanguage" : "en",
  "mainEntityOfPage" : {
    "@id" : "https://blog.ishosting.com/en/self-hosted-dify",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "address" : [ {
      "@type" : "PostalAddress",
      "addressCountry" : "EE",
      "addressLocality" : "Tallinn",
      "addressRegion" : "Harju maakond",
      "postalCode" : "10120",
      "streetAddress" : "Kesklinna linnaosa, Tuukri tn 19-315"
    }, {
      "@type" : "PostalAddress",
      "addressCountry" : "GB",
      "addressLocality" : "London",
      "addressRegion" : "England",
      "postalCode" : "W1W 7LT",
      "streetAddress" : "85 Great Portland Street, First Floor"
    } ],
    "description" : "is*hosting is an IaaS provider since 2005. We provide VPS, VPN, dedicated servers and data storage to help you achieve your biggest dreams.",
    "email" : "sales@ishosting.com",
    "foundingDate" : "2005",
    "legalName" : "WEBRAIN OÜ",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 26,
      "url" : "https://help.ishosting.com/hubfs/logo-ishosting.png",
      "width" : 138
    },
    "name" : "is*hosting"
  },
  "thumbnailUrl" : "https://25913237.fs1.hubspotusercontent-eu1.net/hubfs/25913237/blog/self-hosted-dify/self-hosted-dify.png",
  "timeRequired" : "PT9M",
  "url" : "https://blog.ishosting.com/en/self-hosted-dify",
  "wordCount" : 3224
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "BreadcrumbList",
  "itemListElement" : [ {
    "@type" : "ListItem",
    "item" : "https://blog.ishosting.com/en",
    "name" : "Blog",
    "position" : 1
  }, {
    "@type" : "ListItem",
    "item" : "https://blog.ishosting.com/en/tag/technology",
    "name" : "Technology",
    "position" : 2
  }, {
    "@type" : "ListItem",
    "item" : "https://blog.ishosting.com/en/self-hosted-dify",
    "name" : "How to Self-Host Your AI Workflow Platform: Dify.AI on a VPS",
    "position" : 3
  } ]
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "is*hosting team",
    "url" : "https://blog.ishosting.com/en/author/team-ishosting"
  },
  "dateModified" : "2026-11-26T10:52:38.526Z",
  "datePublished" : "2026-05-14T08:00:00.000Z",
  "headline" : "Self-Host Dify.AI on a VPS: Install & Production Guide",
  "image" : [ "https://blog.ishosting.com/hubfs/blog/self-hosted-dify/self-hosted-dify.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.ishosting.com/en/self-hosted-dify",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.ishosting.com/hubfs/logo-ishosting.png"
    },
    "name" : "WEBRAIN OÜ"
  }
}
```