Dify is an open-source LLM app development platform, visual workflow design, RAG pipelines, agents, model management, and observability, with support for hundreds of proprietary and open-source models. This guide deploys Dify's bundled Docker Compose stack (Nginx, PostgreSQL, Redis, Weaviate), provisions Let's Encrypt TLS via Certbot, connects a model provider, and builds a chatflow-based support chatbot.
Prerequisites: a Linux server (2 vCPU / 4GB RAM minimum), Docker + Docker Compose, a domain A record (e.g.
dify.example.com), an API key from a model provider (OpenAI, Anthropic, Cohere, etc.).
Set Up the Project
$ curl -sL https://github.com/langgenius/dify/archive/refs/tags/1.14.1.tar.gz | tar -xz
$ mv dify-1.14.1 ~/dify
$ cd ~/dify/docker
$ cp .env.example .env
$ sed -i "s|^SECRET_KEY=.*|SECRET_KEY=$(openssl rand -base64 42)|" .env
Edit .env for your domain — CERTBOT_DOMAIN/CERTBOT_EMAIL aren't in the default file, add them:
$ nano .env
NGINX_SERVER_NAME=dify.example.com
NGINX_SSL_CERT_FILENAME=fullchain.pem
NGINX_SSL_CERT_KEY_FILENAME=privkey.pem
NGINX_ENABLE_CERTBOT_CHALLENGE=true
CONSOLE_API_URL=https://dify.example.com
CONSOLE_WEB_URL=https://dify.example.com
SERVICE_API_URL=https://dify.example.com
APP_API_URL=https://dify.example.com
APP_WEB_URL=https://dify.example.com
CERTBOT_DOMAIN=dify.example.com
CERTBOT_EMAIL=admin@example.com
Deploy with Docker Compose
Dify ships a 1,200+ line Compose file (PostgreSQL, Redis, Weaviate vector store, Nginx, and the app services). Deployment happens in two stages: bring services up on HTTP first, then provision the cert and flip to HTTPS.
1. Start on HTTP:
$ docker compose up -d
$ docker compose ps -a
All services should show Up, with healthy on the ones that define a health check (db_postgres, redis, sandbox).
2. Provision the certificate:
$ docker compose --profile certbot up -d certbot
$ docker compose exec certbot /bin/sh /update-cert.sh
Certbot runs the HTTP-01 challenge and writes certs to volumes/certbot/conf/live/<domain>/.
3. Flip on HTTPS and recreate Nginx:
$ sed -i "s|^NGINX_HTTPS_ENABLED=.*|NGINX_HTTPS_ENABLED=true|" .env
$ docker compose --profile certbot up -d --no-deps --force-recreate nginx
First-Run Setup
1. Create the admin account at https://dify.example.com/install: email, username, password, Set up.
2. Log in at https://dify.example.com/signin.
3. Connect a model provider: profile avatar → Settings → Model Provider → find your provider (OpenAI, Anthropic, DeepSeek, etc.), Install (Dify pulls the plugin from its marketplace on demand), paste your API key, Save. Confirm it shows up under configured providers with at least one chat model available.
Build a Support Chatbot
1. Studio → Create from Blank → Chatflow. Name it Support Assistant, set icon/description, Create. You get Start → LLM → Answer nodes pre-wired.
2. Configure the LLM node:
- Pick your chat model (e.g.
gpt-4o,claude-sonnet-5) - System prompt:
You are a customer support agent for a SaaS product. Answer questions about billing, installation, and integrations in a clear, concise tone. Refer the user to the documentation when a question falls outside your knowledge.
- Enable MEMORY with WINDOW SIZE
10to keep conversation context.
3. Publish → Publish Update.
4. Test it: Preview, send something like The platform charged the subscription twice this month. Can you help with a refund? — confirm the response is coherent and on-topic.
5. Run standalone: Publish dropdown → Run App for the dedicated chat interface.
Next Steps
Dify is running with TLS and a memory-aware chatbot backed by your model provider. From here:
- Add a knowledge base and wire in RAG retrieval nodes for document-grounded answers
- Build an Agent app type for tool-calling workflows instead of a plain chatflow
- Expose the app via Dify's API for embedding in an external product
For the full guide, visit the original article on Vultr Docs.
Top comments (0)