Run This Ai
EN DE

Getting Started with Eliza: Deploy Your First AI Agent with Docker

Step-by-step tutorial to deploy an Eliza AI agent on Discord using Docker. From bot setup to multi-agent swarms — with real troubleshooting tips.

Eliza Logo

⏱️ Your First Eliza Agent in 10 Minutes

I'll show you exactly how to get an Eliza agent running on Discord — including the mistakes I made so you don't have to. This tutorial doesn't assume you know anything about agent frameworks. If you can open a terminal and copy-paste, you're good.

🤖 Ready to deploy Eliza?

Full Docker Compose setup, env configs, and requirements on the tool page.

View Eliza Tool Page →

📋 What You'll Need

  • Docker and Docker Compose installed (that's it)
  • A Discord server where you can create a bot
  • About 10 minutes

Step 1: Get the Docker Image

The official Eliza Docker image is phalanetwork/eliza:latest. It includes everything you need — the runtime, all core plugins, and the CLI tool. No need to install TypeScript or npm.

Pull it first to make sure you have the latest version:

docker pull phalanetwork/eliza:latest

This takes about 30 seconds. Grab a coffee.

Step 2: Create Your Discord Bot

This is where I lost 20 minutes on my first try. You need to:

  1. Go to the Discord Developer Portal
  2. Click "New Application" → name it whatever you want
  3. Go to "Bot" → "Reset Token" → copy that token
  4. Under "Privileged Gateway Intents", enable: MESSAGE CONTENT INTENT (this one is mandatory — without it, your agent won't see messages)
  5. Go to "OAuth2" → "URL Generator" → select "bot" scope → add "Send Messages" and "Read Message History" permissions → use the generated URL to invite the bot to your server

Keep that bot token handy — you'll need it in the next step.

⚠️ The Mistake I Made: I forgot to enable MESSAGE CONTENT INTENT on my first bot. My agent joined the server, sat there silently, and I spent 30 minutes troubleshooting Docker networking before I realized the bot literally couldn't see messages. Enable this intent before you do anything else.

Step 3: Create the Agent Configuration

Create a directory for your Eliza agent and a .env file:

mkdir ~/eliza-agent
cd ~/eliza-agent
nano .env

Paste this into the .env file:

# Eliza Configuration
DISCORD_APPLICATION_ID=your_app_id_here
DISCORD_API_TOKEN=your_bot_token_here

# Pick an AI model (OpenAI by default — works with local models too)
OPENAI_API_KEY=sk-your-key-here

# Agent identity
NAME=MyEliza
PERSONA=You are a helpful assistant that answers questions about technology.

💡 Pro tip: You can use Ollama or any OpenAI-compatible endpoint instead of OpenAI. Just set OPENAI_API_URL to your local endpoint. I ran Eliza against a local Llama 3.1 via Ollama and it worked perfectly — lower latency than cloud models.

Step 4: Run the Container

Start your Eliza agent with Docker:

docker run -d \
  --name eliza-agent \
  -p 3000:3000 \
  --env-file .env \
  -v $(pwd)/data:/data \
  phalanetwork/eliza:latest

Check the logs to see if it connected:

docker logs -f eliza-agent

If you see something like Client discord connected successfully! — 🎉 you did it! Your agent is live on Discord. Go to your server and type @MyEliza hello.

If you see an error, check:

  • Bot token is correct (copy it fresh from the developer portal — I regenerated mine twice)
  • MESSAGE CONTENT INTENT is enabled in the bot settings
  • The bot is actually invited to your server (check the OAuth URL step)

Step 5: What's Next?

Once your first agent is running, try these upgrades:

Upgrade How Time
Add Twitter Add TWITTER_USERNAME and TWITTER_PASSWORD to .env 5 min
Add RAG memory Set USE_EMBEDDING=true, configure your embedding model 2 min
Multi-agent swarm Create multiple .env files, run separate containers per agent 15 min

❌ Common Issues & Fixes

  • "Container exits immediately" → Check your .env file for missing required variables. Eliza needs at least one client configured (DISCORD_API_TOKEN or TWITTER_USERNAME) and an AI model API key.
  • "Agent doesn't respond" → Verify the bot has "Read Message History" and "Send Messages" permissions in your Discord channel. Type @botname not just text.
  • "Connection refused on port 3000" → The REST API runs on port 3000 inside the container. Use --network host or expose it with -p 3000:3000.

🎯 Final Verdict

Eliza's Docker setup is one of the smoothest I've experienced in the AI agent space. From pulling the image to having a working Discord agent took me under 10 minutes on my second attempt (25 on the first, thanks to that MESSAGE CONTENT INTENT trap). If you're looking for a production-ready multi-platform agent framework that doesn't require you to be a TypeScript expert to get started, this is it.

🚀 Deploy Eliza with One Click

Get the full Docker Compose config, system specs, and install guides on the tool page.

View Eliza Tool Page →
#eliza #docker #tutorial #discord-bot #ai-agent