GitLab Integration
Push code to GitLab → Auto-deploy to Flux Network. Works with GitLab.com and self-hosted GitLab.
Quick Setup
Step 1: Deploy on Flux Cloud
- Go to cloud.runonflux.com
- Login with your preferred method
- Click Register New App
- Use these settings:
App Name: my-gitlab-app
Docker Image: runonflux/orbit:latest
Port: 3000 # Your app's port
Port 2: 9001 # Webhook listener port
Environment Variables:
GIT_REPO_URL: https://gitlab.com/YOU/YOUR-PROJECT
APP_PORT: 3000
WEBHOOK_SECRET: choose-a-secret-token
Step 2: Add GitLab Webhook
- Go to your GitLab project
- Navigate to Settings → Webhooks
- Fill in:
- URL:
https://YOUR-APP-9001.app.runonflux.io/webhook - Secret Token: Your secret from Step 1
- Trigger: ✅ Push events
- SSL Verification: Enable (if using HTTPS)
- URL:
- Click Add webhook
Step 3: Test It
Click Test → Push events in GitLab webhook settings.
Or push some code:
git add .
git commit -m "Test GitLab webhook"
git push
Your app will update automatically!
Private Repositories
For private GitLab repos, create and add an access token:
Environment Variables:
GIT_REPO_URL: https://gitlab.com/YOU/private-project
GIT_TOKEN: glpat-your_gitlab_token
GIT_USERNAME: your_username # Optional
APP_PORT: 3000
How to create a token:
- GitLab → Settings → Access Tokens
- Name:
flux-orbit-deploy - Scope: ✅
read_repository - Click Create personal access token
- Copy the token to your Flux app
Self-Hosted GitLab
Works the same way! Just use your GitLab server URL:
Environment Variables:
GIT_REPO_URL: https://gitlab.company.com/team/project
GIT_TOKEN: your_token
WEBHOOK_SECRET: your_secret
Deploy Different Branches
Run multiple environments:
Production:
App Name: app-production
Environment Variables:
GIT_BRANCH: main
APP_PORT: 3000
Staging:
App Name: app-staging
Environment Variables:
GIT_BRANCH: develop
APP_PORT: 3001
Check Deployment Status
View logs in Flux dashboard, or if you have SSH access:
# Recent webhook activity
docker exec YOUR-APP tail -20 /app/logs/webhook.log
# Live deployment progress
docker exec YOUR-APP tail -f /app/logs/update.log
Troubleshooting
Webhook Shows Error?
Common fixes:
- Ensure port 9001 is exposed in Flux app settings
- Check the secret token matches exactly
- Verify your app URL is accessible from internet
GitLab CI/CD Integration
Want to deploy from GitLab CI instead? Add to .gitlab-ci.yml:
deploy:
stage: deploy
script:
- |
curl -X POST $WEBHOOK_URL \
-H "X-Gitlab-Token: $WEBHOOK_SECRET" \
-d '{"ref":"refs/heads/main"}'
only:
- main
Set WEBHOOK_URL and WEBHOOK_SECRET in GitLab CI variables.
Alternative: Polling Mode
Skip webhooks entirely - let Flux-Orbit check for updates:
Environment Variables:
POLLING_INTERVAL: 300 # Check every 5 minutes
# No webhook needed!
Pro Tips
- Use Protected Branches - Deploy only from protected branches for safety
- Tag Deployments - Deploy specific versions using Git tags
- Monitor Deliveries - GitLab shows webhook delivery history with details
Next Steps
- Deploy from GitHub or Bitbucket
- Learn about Deployment Hooks
- Set up Environment Variables
Need help?
- Documentation: orbit.app.runonflux.io
- Community: Flux Discord
- Issues: GitHub