Prerequisites
- A Zerops account
- Basic knowledge of Go
- Go installed locally (for development)
Deploy from Recipe
The fastest way to get started is to deploy our ready-made Go example:Import the Project
Log in to Zerops GUI and click Import a project.
Deploy Your Own Go Application
Step 1: Create Your Application
Create a simple HTTP server:main.go
Step 2: Add zerops.yaml
Create azerops.yaml file in your repository root:
Step 3: Configure Your Service
- Using zCLI
- Using GUI
Create a Import the project:
description.yaml:Step 4: Deploy Your Code
Deploy using zCLI:Framework Examples
Gin Framework
Install Gin:main.go
zerops.yaml
Echo Framework
main.go
Fiber Framework
main.go
Adding a Database
Extend your project with PostgreSQL:description.yaml
Environment Variables
Set environment variables inzerops.yaml:
Build Optimizations
Create Smaller Binaries
Use build flags to reduce binary size:Cache Go Modules
Speed up builds by caching dependencies:Multi-Stage Builds
For complex applications with multiple binaries:Troubleshooting
Build fails with module errors
Build fails with module errors
Ensure
go.mod and go.sum are committed:Application doesn't start
Application doesn't start
Check that your start command and port configuration match:
Binary not found
Binary not found
Make sure you’re deploying the compiled binary:
CGO errors
CGO errors
For CGO dependencies, install build tools:
Next Steps
Runtime Overview
Learn about Go runtime features
Environment Variables
Manage secrets and configuration
Scaling
Configure auto-scaling
Monitoring
Monitor your application