Quick Start
This guide will help you quickly deploy and run gocron.
Requirements
- Go: 1.23+
- Database: MySQL / PostgreSQL / SQLite (see notes below)
- Node.js: 20+ (only for frontend development)
Database Support
| Deployment Method | MySQL | PostgreSQL | SQLite |
|---|---|---|---|
| Docker Deployment | ✅ Supported | ✅ Supported | ✅ Supported |
| Kubernetes Deployment | ✅ Supported | ✅ Supported | ✅ Supported |
| Binary Deployment | ✅ Supported | ✅ Supported | ✅ Supported |
| Development Environment | ✅ Supported | ✅ Supported | ✅ Supported |
Note
- All deployment methods support all three databases. gocron uses a pure Go SQLite driver, no CGO required.
- Production Recommendation: Use MySQL or PostgreSQL for better performance and distributed deployment support
Docker Compose Deployment (Recommended)
Docker deployment is the simplest and fastest way, suitable for quick testing and evaluation.
Steps
# 1. Clone the project
git clone https://github.com/gocronx-team/gocron.git
cd gocron
# 2. Start services (automatically builds image)
docker-compose up -d
# 3. Access web interface
# http://localhost:5920Default Credentials
- Username:
admin - Password:
admin123
Tip
- Docker Compose only deploys the gocron management server
- Task nodes (gocron-node) need to be installed separately
- See Agent Auto-Registration for installing task nodes
Kubernetes Deployment (Helm)
Deploy to Kubernetes clusters with a single command using Helm Chart.
Add Helm Repository
helm repo add gocron https://gocronx-team.github.io/gocron
helm repo updateDeploy
# SQLite (default, simplest)
helm install gocron gocron/gocron
# MySQL
helm install gocron gocron/gocron \
--set db.engine=mysql \
--set db.host=mysql.default \
--set db.port=3306 \
--set db.user=gocron \
--set db.password=your_password \
--set db.database=gocron
# PostgreSQL
helm install gocron gocron/gocron \
--set db.engine=postgres \
--set db.host=pg.default \
--set db.port=5432 \
--set db.user=gocron \
--set db.password=your_password \
--set db.database=gocronConfigure Ingress
helm install gocron gocron/gocron \
--set ingress.enabled=true \
--set 'ingress.hosts[0].host=gocron.example.com' \
--set 'ingress.hosts[0].paths[0].path=/' \
--set 'ingress.hosts[0].paths[0].pathType=Prefix'Tip
For full Helm configuration options, see Kubernetes Deployment.
Binary Deployment (Production Recommended)
Suitable for production environments, supports all databases (including SQLite).
Download Package
Visit GitHub Releases to download the latest version.
Choose the package for your platform:
- Linux:
gocron-linux-amd64.tar.gzorgocron-linux-arm64.tar.gz - macOS:
gocron-darwin-amd64.tar.gzorgocron-darwin-arm64.tar.gz - Windows:
gocron-windows-amd64.ziporgocron-windows-arm64.zip
Installation Steps
# 1. Extract the package
tar -xzf gocron-linux-amd64.tar.gz
cd gocron-linux-amd64
# 2. Configure database (optional)
# Edit .gocron/conf/app.ini
# Uses SQLite by default, no configuration needed
# 3. Start service
./gocron web
# 4. Access web interface
# http://localhost:5920Database Configuration
gocron supports three databases, choose according to your needs:
SQLite (Default)
No configuration needed, works out of the box. Suitable for small deployments and testing.
MySQL
Edit .gocron/conf/app.ini:
[db]
engine = mysql
host = 127.0.0.1
port = 3306
user = root
password = your_password
database = gocron
charset = utf8mb4PostgreSQL
Edit .gocron/conf/app.ini:
[db]
engine = postgres
host = 127.0.0.1
port = 5432
user = postgres
password = your_password
database = gocronDevelopment Environment
Suitable for development and debugging.
Prerequisites
- Go 1.23+
- Node.js 20+
- Yarn
Steps
# 1. Clone the project
git clone https://github.com/gocronx-team/gocron.git
cd gocron
# 2. Install Go dependencies
go mod download
# 3. Configure database
# Edit .gocron/conf/app.ini
# Or copy app.ini.sqlite.example to use SQLite
# 4. Install development tools
go install github.com/air-verse/air@latest
# 5. Start backend (with hot reload)
air
# 6. Start frontend (in another terminal)
cd web/vue
yarn install
yarn run devVisit http://localhost:8080
Install Task Nodes
gocron uses a distributed architecture where tasks execute on independent nodes.
Method 1: Auto-Registration (Recommended)
Use the web interface to generate one-click installation commands. See Agent Auto-Registration for details.
Method 2: Manual Installation
# 1. Download gocron-node package
# Visit GitHub Releases to download the package for your platform
# 2. Extract
tar -xzf gocron-node-linux-amd64.tar.gz
cd gocron-node-linux-amd64
# 3. Start node
./gocron-node
# 4. Add node in web interface
# Go to "Task Nodes" page and click "Add Node"Verify Installation
- Access web interface: http://localhost:5920
- Login with default credentials (admin / admin123)
- Go to "Task Nodes" page and confirm nodes are connected
- Create a test task and verify execution
Next Steps
- Configuration - Learn about detailed configuration options
- Kubernetes Deployment - Full Helm Chart configuration
- Scheduled Tasks - Learn how to create and manage tasks
- Agent Auto-Registration - Quickly deploy task nodes
- API Documentation - Manage tasks using API
FAQ
Can I use SQLite with Docker deployment?
Yes. Since gocron v1.5.9+, a pure Go SQLite driver is used and Docker images fully support SQLite.
How to change the default port?
# Method 1: Command line argument
./gocron web -p 8080
# Method 2: Configuration file
# Edit .gocron/conf/app.ini
[server]
port = 8080How to enable HTTPS?
See Security - TLS Mutual Authentication chapter.
Task node cannot connect?
- Check if the node is running properly
- Check firewall settings
- Confirm node address is configured correctly
- Check node logs:
log/cron.log