Prerequisites
- A Zerops account (sign up if you don’t have one)
- A project in Zerops (create one in the GUI if needed)
Step 1: Create Nginx Service
You can create an Nginx service using either the Zerops GUI or zCLI.- Using GUI
- Using zCLI
- Navigate to your project dashboard
- Click Add new service in the Services menu
- Select Nginx as the service type
- Choose your Nginx version (or use
latest) - Set a unique hostname (e.g.,
app,web,frontend) - Optionally configure:
- Secret environment variables
- Auto scaling settings
- Click Create service
The hostname must be unique within your project, contain only lowercase letters (a-z) or numbers (0-9), and be maximum 25 characters.
Step 2: Configure Your Application
Create azerops.yaml file in the root of your repository to configure how Zerops builds and runs your application.
- Pre-built Files
- Build + Deploy
- Advanced
If you already have built static files and just want to deploy them:This minimal configuration:
zerops.yaml
- Uses the latest Nginx version
- Serves files from the
/var/www/publicdirectory - Uses default settings for everything else
Step 3: Deploy Your Application
- From Git
- Using zCLI
The recommended approach is to connect your Git repository:
- Go to your service detail in Zerops GUI
- Click Connect to GitHub/GitLab
- Authorize Zerops and select your repository
- Choose the branch to deploy from
- Zerops will automatically detect your
zerops.yaml - Click Deploy
Step 4: Configure Public Access
By default, your service is only accessible within the Zerops private network. To make it publicly accessible:- Go to your service detail in Zerops GUI
- Navigate to Public access & routing in the left menu
- Click Add new routing rule
- Configure your domain:
- Use a Zerops subdomain (e.g.,
app.zerops.app) - Or add your custom domain
- Use a Zerops subdomain (e.g.,
- Save the routing rule
For custom domains, you’ll need to add DNS records pointing to Zerops. The GUI will show you exactly what records to create.
Example: Deploy a React App
Here’s a complete example for deploying a React application:zerops.yaml
- Add
zerops.yamlto your React project root - Commit and push to your Git repository
- Connect the repository in Zerops GUI
- Watch the build and deploy process
- Access your app via the provided URL
Next Steps
Environment Variables
Configure environment variables
Custom Nginx Config
Customize your web server
SEO Optimization
Set up Prerender.io for better SEO
Scaling
Configure auto scaling
Common Issues
My app shows a blank page
My app shows a blank page
Check that your
documentRoot in zerops.yaml matches where your build output is located. For example, if your build creates a dist folder, use documentRoot: dist.Client-side routing doesn't work (404 errors)
Client-side routing doesn't work (404 errors)
The default Nginx configuration handles this automatically with
try_files $uri $uri/ /index.html. If you’ve customized your Nginx config, make sure you have this directive.Build fails with 'command not found'
Build fails with 'command not found'
Make sure you’re using the correct base image for your build. For example, if you’re using npm commands, you need
base: nodejs@<version> in your build section.How do I see build logs?
How do I see build logs?
Go to your service detail in Zerops GUI, click on Service dashboard & runtime containers, then Open pipeline detail to see complete build and deploy logs.