OneDev All-in-One DevOps
Self-hosted DevOps platform with Git, CI/CD, and project management.
Overview
OneDev is a self-hosted all-in-one DevOps platform that combines Git repository management, continuous integration/continuous deployment (CI/CD), and project management into a single cohesive solution. Created as an alternative to managing multiple disparate tools, OneDev provides built-in issue tracking, pull request workflows, build automation, and project boards while maintaining complete control over your development infrastructure. Unlike cloud-based solutions, OneDev runs entirely on your own infrastructure, ensuring data sovereignty and customization flexibility.
This stack pairs OneDev with PostgreSQL to create a production-ready development platform. PostgreSQL serves as OneDev's primary database, storing Git metadata, issue tracking data, build configurations, and user management information. The combination leverages PostgreSQL's ACID compliance and robust transaction support to ensure data integrity across all DevOps operations, from code commits to build pipeline executions. PostgreSQL's advanced indexing and query optimization capabilities handle OneDev's complex relational queries for repository searches, build history analysis, and project reporting.
This configuration is ideal for development teams seeking to consolidate their toolchain without sacrificing functionality or control. Organizations migrating from GitHub/GitLab combinations or those requiring on-premises DevOps solutions will find this stack particularly valuable. The setup provides enterprise-grade Git hosting, sophisticated CI/CD pipelines with YAML configuration, and integrated project management tools that rival commercial offerings while maintaining complete administrative control.
Key Features
- Built-in Git server with advanced repository management and branch protection rules
- YAML-based CI/CD pipelines with Docker-in-Docker build execution capabilities
- Integrated issue tracking with customizable workflows and project boards
- Pull request management with code review tools and merge conflict resolution
- PostgreSQL-backed data persistence ensuring ACID compliance for all DevOps operations
- SSH Git access on port 6611 for command-line repository operations
- Docker socket mounting enabling containerized build environments
- Comprehensive user management with role-based access control and team permissions
Common Use Cases
- 1Small to medium development teams consolidating from multiple DevOps tools into a single platform
- 2Organizations requiring on-premises Git hosting with integrated CI/CD capabilities
- 3Companies migrating from cloud-based solutions to maintain data sovereignty and control
- 4Development teams needing tight integration between source control and project management
- 5Startups seeking enterprise DevOps functionality without per-user licensing costs
- 6Educational institutions teaching DevOps practices with a complete, self-contained platform
- 7Open source projects requiring robust hosting with integrated community contribution workflows
Prerequisites
- Docker host with minimum 2GB RAM (OneDev requires 1GB+ and PostgreSQL needs 512MB+)
- Available ports 6610 (OneDev web interface) and 6611 (SSH Git access)
- Docker socket access for OneDev's containerized build system
- POSTGRES_PASSWORD environment variable configured for database authentication
- Basic understanding of Git workflows and CI/CD pipeline concepts
- Sufficient disk space for Git repositories and build artifacts (recommend 20GB+ initial allocation)
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 postgres: 3 image: postgres:15-alpine4 environment: 5 - POSTGRES_USER=onedev6 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}7 - POSTGRES_DB=onedev8 volumes: 9 - postgres_data:/var/lib/postgresql/data10 networks: 11 - onedev_net1213 onedev: 14 image: 1dev/server:latest15 ports: 16 - "6610:6610"17 - "6611:6611"18 environment: 19 - hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect20 - hibernate_connection_driver_class=org.postgresql.Driver21 - hibernate_connection_url=jdbc:postgresql://postgres:5432/onedev22 - hibernate_connection_username=onedev23 - hibernate_connection_password=${POSTGRES_PASSWORD}24 volumes: 25 - onedev_data:/opt/onedev26 - /var/run/docker.sock:/var/run/docker.sock27 depends_on: 28 - postgres29 networks: 30 - onedev_net3132volumes: 33 postgres_data: 34 onedev_data: 3536networks: 37 onedev_net: .env Template
.env
1# OneDev2POSTGRES_PASSWORD=secure_postgres_password34# OneDev at http://localhost:66105# SSH at localhost:66116# Complete setup wizard on first accessUsage Notes
- 1OneDev at http://localhost:6610
- 2SSH at port 6611
- 3Complete setup wizard first
- 4Built-in CI/CD with YAML
- 5Issue tracking and boards
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
postgres
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_USER=onedev
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=onedev
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- onedev_net
onedev
onedev:
image: 1dev/server:latest
ports:
- "6610:6610"
- "6611:6611"
environment:
- hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect
- hibernate_connection_driver_class=org.postgresql.Driver
- hibernate_connection_url=jdbc:postgresql://postgres:5432/onedev
- hibernate_connection_username=onedev
- hibernate_connection_password=${POSTGRES_PASSWORD}
volumes:
- onedev_data:/opt/onedev
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- postgres
networks:
- onedev_net
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 postgres:5 image: postgres:15-alpine6 environment:7 - POSTGRES_USER=onedev8 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}9 - POSTGRES_DB=onedev10 volumes:11 - postgres_data:/var/lib/postgresql/data12 networks:13 - onedev_net1415 onedev:16 image: 1dev/server:latest17 ports:18 - "6610:6610"19 - "6611:6611"20 environment:21 - hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect22 - hibernate_connection_driver_class=org.postgresql.Driver23 - hibernate_connection_url=jdbc:postgresql://postgres:5432/onedev24 - hibernate_connection_username=onedev25 - hibernate_connection_password=${POSTGRES_PASSWORD}26 volumes:27 - onedev_data:/opt/onedev28 - /var/run/docker.sock:/var/run/docker.sock29 depends_on:30 - postgres31 networks:32 - onedev_net3334volumes:35 postgres_data:36 onedev_data:3738networks:39 onedev_net:40EOF4142# 2. Create the .env file43cat > .env << 'EOF'44# OneDev45POSTGRES_PASSWORD=secure_postgres_password4647# OneDev at http://localhost:661048# SSH at localhost:661149# Complete setup wizard on first access50EOF5152# 3. Start the services53docker compose up -d5455# 4. View logs56docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/onedev-devops/run | bashTroubleshooting
- OneDev startup fails with database connection errors: Ensure PostgreSQL container is fully initialized before OneDev starts, increase depends_on wait time if necessary
- Git clone/push operations fail on port 6611: Verify SSH port 6611 is accessible and not blocked by firewall, check Docker host port binding configuration
- Build pipelines fail with Docker socket errors: Confirm /var/run/docker.sock is properly mounted and accessible, ensure Docker daemon is running on host
- OneDev web interface shows 'hibernate.dialect' errors: Verify PostgreSQL environment variables match OneDev's database connection settings exactly
- Performance issues during large repository operations: Increase PostgreSQL shared_buffers and effective_cache_size, consider allocating more memory to both containers
- Setup wizard repeatedly fails: Clear onedev_data volume and restart containers, ensure POSTGRES_PASSWORD is consistently set across both services
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download