Up and Running
This guide walks you through deploying DAIV using Docker Swarm or Docker Compose. DAIV is an AI-powered development assistant that helps teams with code insights, automated issue resolution, and development workflow automation. After completing this guide, you'll have a fully functional DAIV instance ready to connect to your codebase.
What You'll Deploy
DAIV requires several core services to function properly. You'll deploy these services using container orchestration:
Required Core Services:
- PostgreSQL with pgvector extension - Stores application data and vector embeddings;
- Redis - Handles caching and message queueing;
- DAIV Application - Main API;
- DAIV Worker - Background task processor.
Optional Service:
- DAIV Sandbox - Isolated environment for running arbitrary code;
- MCP Proxy - Proxy MCP server to run other MCP servers inside a container.
Docker Swarm (Recommended)
Docker Swarm provides better production deployment capabilities including service discovery, load balancing, and rolling updates. This guide covers single-server deployment, but you can extend it to multiple servers using the Docker Swarm documentation.
Prerequisites
- Docker installed with Swarm enabled
- Internet connection to pull container images
- Basic understanding of Docker Swarm
Step 1: Create Docker Secrets
Before deploying, you must create these Docker secrets. These secrets store sensitive configuration data securely:
Required Secrets:
django_secret_key
- Random secret key for Django (generate one here)db_password
- Random password for the PostgreSQL databasecodebase_gitlab_auth_token
- GitLab personal access token withapi
scope (see how to create one)codebase_gitlab_webhook_secret
- Random secret for GitLab webhook validationcodebase_embeddings_api_key
- OpenAI API key with access totext-embedding-3-large
modeldaiv_sandbox_api_key
- Random API key for Sandbox service authenticationopenrouter_api_key
- OpenRouter API key for LLM accessmcp_proxy_auth_token
- Random API key for MCP Proxy service authentication
Create each secret using this command (see Docker Secrets documentation for more details):
Bash | |
---|---|
Additional Secrets May Be Required
These are the minimal secrets for basic DAIV functionality. Check the Environment Variables page for additional secrets needed for specific features or services.
Step 2: Create stack.yml
file
Create your deployment configuration file. This YAML file defines all services, networks, and volumes needed for DAIV.
Customize Environment Variables
Replace all annotated values with your own configuration. See the Environment Variables page for complete configuration options.
YAML | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
- Replace
your-hostname.com
with your domain name. Don't include the schema (e.g., usedaiv.com
nothttps://daiv.com
). Keepapp
and127.0.0.1
for internal service communication. - Replace with your full domain URL including schema (e.g.,
https://your-hostname.com
) - Set to your GitLab instance URL (e.g.,
https://gitlab.com
for GitLab.com) - Points to the Sandbox service. Use
http://sandbox:8000
when deploying Sandbox in the same stack - Recommended: Replace
latest
with a specific version tag for production deployments - Number of parallel worker processes. Adjust based on your server resources and expected workload
- See DAIV Sandbox documentation for configuration details
- Required: Sandbox needs Docker socket access to create isolated containers
- Optional: Remove this volume if you don't need private registry access
Step 3: Deploy the stack
Deploy your DAIV stack by running this command from the directory containing your stack.yml
file:
Bash | |
---|---|
Monitor deployment progress with these commands:
Bash | |
---|---|
Deployment Time
Services may take several minutes to become fully healthy, especially during the initial deployment when images are being pulled and databases are being initialized.
Step 4: ⏭️ Next steps
Your DAIV deployment is now running! Follow the Reverse Proxy guide below to configure external access, then proceed to connect your first repository.
Docker Compose
Docker Compose provides simpler deployment suitable for development environments or smaller production setups. This method uses a single configuration file to manage all services.
Prerequisites
- Docker installed with Compose
- Internet connection to pull container images
Step 1: Create docker-compose.yml
file
Create your Docker Compose configuration. This file defines all services and their configurations in a single place.
Environment Variable Configuration
Replace all annotated values with your specific configuration. See the Environment Variables page for additional options.
YAML | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
- Generate a Django secret key - Use a cryptographically secure random string
- Replace with your domain name - Don't include schema (e.g.,
daiv.com
) - Generate a secure random password for the database
- Set your GitLab instance URL (e.g.,
https://gitlab.com
) - Create a GitLab personal access token with
api
scope permissions (see how to create one) - Generate a random webhook secret for GitLab webhook validation
- Get an OpenAI API key with access to
text-embedding-3-large
model - Get an OpenRouter API key for LLM model access
- Generate a random API key for Sandbox service authentication
- Use the same password as defined in annotation 3
- Use the same API key as defined in annotation 9
- Include the full URL with schema (e.g.,
https://your-hostname.com
) - Generate a random API key for MCP Proxy service authentication
Step 2: Run the compose file
Start all DAIV services by running this command from the directory containing your docker-compose.yml
:
Bash | |
---|---|
Check service status to ensure everything is running correctly:
Bash | |
---|---|
Step 3: ⏭️ Next steps
Your DAIV instance is now operational! Continue with the Reverse Proxy configuration below, then proceed to connect your first repository.
Reverse Proxy
Configure a reverse proxy to provide secure external access to your DAIV instance. This setup enables HTTPS access and proper domain routing.
This guide covers Nginx configuration. Basic Nginx knowledge is assumed.
Contributions Welcome
Only Nginx configuration is provided currently. Contributions for Apache, Traefik, and other reverse proxy configurations are welcome!
Prerequisites
- Nginx installed
- Valid SSL certificate for your domain
- Domain name pointing to your server
Step 1: Configure Nginx
Create a new Nginx configuration file at /etc/nginx/conf.d/daiv.conf
(path may vary by operating system).
Add this configuration and customize the annotated values:
- Set the internal IP of your DAIV instance. Use
localhost
or127.0.0.1
if running on the same server - Replace with your domain name (e.g.,
daiv.example.com
) - Update the SSL certificate path - Location varies by operating system
- Update the SSL certificate key path - Location varies by operating system
Step 2: Restart Nginx
Apply the configuration changes by restarting Nginx:
Bash | |
---|---|
Verify the configuration by accessing your domain in a web browser. You should see the DAIV interface.
🚀 Final Steps and Repository Configuration
Congratulations! Your DAIV instance is now running and accessible. To start using DAIV with your repositories, follow these essential next steps:
1. Connect Your First Repository
Your next step is connecting DAIV to your GitLab repositories. This process involves:
- Creating GitLab personal access tokens
- Configuring repository webhooks
- Indexing repository content
- Setting up automated workflows\
📖 Follow the complete repository setup guide: Repository Configuration
2. What You Can Do After Configuration
Once your repository is connected, DAIV will automatically:
- Respond to issues - DAIV analyzes issues and suggests solutions or implementation plans
- Review pull requests - Automated code review and suggestions for improvements
- Address pipeline failures - Investigates CI/CD failures and proposes fixes
- Answer code questions - Provides context-aware responses about your codebase
3. Monitoring Your Instance
Keep track of your DAIV deployment:
Bash | |
---|---|
4. Getting Help
If you encounter issues during setup:
- Check the logs for error messages and debugging information
- Review the Environment Variables for configuration options
- Verify network connectivity between services and external APIs
- Ensure all secrets and API keys are valid and have proper permissions
- Ask for help on the GitHub Discussions