Static IP in GitLab CI/CD
Protect production firewalls from GitLab.com's shared pools by routing only the jobs that need a fixed IPv4 through Prontaro.
First payment refunded within 7 days if it doesn’t work for you
- Partner API
- External DB
On this page12
GitLab.com Shared Runners exit from rotating Google Cloud addresses that change between runs. You can keep dedicated CI variables separate from production credentials: HTTP calls use a proxy or Relay URL, while database migrations and SSH/SFTP deploys run through prontaro forward without affecting the rest of your pipeline.
Which method to choose
| Pipeline task | Prontaro method | CLI install needed? |
|---|---|---|
REST API calls, webhooks, smoke tests (curl, Node, Python, Go) |
PRONTARO_PROXY_URL on that step |
No |
Database migrations (psql, Prisma, Flyway) and SSH/SFTP deploys |
PRONTARO_KEY + prontaro forward |
Yes (single binary) |
| Simple HTTPS call to one allowlisted host | PRONTARO_RELAY_URL |
No |
Prerequisites
- A Prontaro account on Dedicated or Pro (plans and pricing) with a dedicated IPv4.
- Your dedicated IP (
/32) added to the destination API, database, or firewall allowlist. - Maintainer or Owner access in your GitLab project to manage Settings → CI/CD → Variables.
Step 1. Create proxy credentials or a CLI token
Create separate credentials dedicated to GitLab CI so you can revoke pipeline access independently of production apps and developer laptops.
Proxy credentials without CLI
- Open IP addresses in my.prontaro.com, pick your IP, and click Create proxy credentials.
- Name them
gitlab-ciand copy thehttps://connection string on port:443.
CLI token for prontaro forward
Issue a dedicated CLI token named gitlab-ci in the dashboard:
The prontaro CLI reads PRONTARO_KEY directly from the environment, so you do not need to run prontaro login or write credentials to the runner disk.
Step 2. Add CI/CD Variables in GitLab
Open Settings → CI/CD → Variables and create the variable for your path. Enable both Masked (redacts the value in job logs) and Protected (exposes the variable only on protected branches and tags such as main or v*).
- PRONTARO_PROXY_URL
- https://u_ci:s3cr3t@<entry>.prontaro.io:443 (Masked, Protected)
- PRONTARO_KEY
- prontaro.<cli-token> (Masked, Protected)
Step 3. Verify the outbound IP
Before restricting allowed proxy targets, confirm that your runner exits through your dedicated IPv4. Add a temporary manual job to .gitlab-ci.yml:
verify_egress_ip:
stage: test
image: curlimages/curl:8.11.1
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: manual
script:
- curl -fsS --proxy "$PRONTARO_PROXY_URL" https://api.ipify.orgRun verify_egress_ip manually on a protected branch. The job log should print your dedicated address:
curl -fsS --proxy "$PRONTARO_PROXY_URL" https://api.ipify.org
203.0.113.10Step 4. Restrict allowed targets
Once api.ipify.org confirms the address, lock the gitlab-ci credentials down to the exact hosts and ports your pipeline calls. Because Shared Runners use dynamic IPs, keep the source allowlist open and tighten the destination list.
- Open the
gitlab-cicredentials under IP addresses in my.prontaro.com and switch to the Access tab. - Under To, add the required
host:portentries (for exampleapi.example.com:443) and save.
Path A. API calls without installing the CLI
Pass PRONTARO_PROXY_URL only to the commands that need your static IP:
partner_sync:
stage: deploy
image: curlimages/curl:8.11.1
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- |
curl -fsS --proxy "$PRONTARO_PROXY_URL" \
-H "Authorization: Bearer $PARTNER_API_TOKEN" \
https://api.example.com/v1/syncPath B. Database migrations and SSH/SFTP deploys with prontaro forward
For PostgreSQL, MySQL, MongoDB, or SSH/SFTP deploys, install the prontaro binary inside the job. The CLI picks up PRONTARO_KEY automatically from the GitLab CI environment.
migrate_prod_db:
stage: deploy
image: postgres:16-alpine
environment:
name: production
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: manual
before_script:
- apk add --no-cache curl netcat-openbsd
- curl -fsSL https://prontaro.com/install.sh | sh
- export PATH="$HOME/.local/bin:$PATH"
script:
- |
set -euo pipefail
prontaro forward 15432 db.example.com:5432 --ip 203.0.113.10 &
FWD_PID=$!
trap 'kill "$FWD_PID" 2>/dev/null || true' EXIT
for i in $(seq 1 30); do
if nc -z 127.0.0.1 15432; then break; fi
sleep 0.5
done
if ! nc -z 127.0.0.1 15432; then
echo "prontaro forward did not open 127.0.0.1:15432" >&2
exit 1
fi
PGPASSWORD="$DATABASE_PASSWORD" psql \
"postgresql://${DATABASE_USER}@127.0.0.1:15432/app?sslmode=require" \
-f migrations/001_schema.sqlFor SSH or SFTP deploys, point prontaro forward at deploy.example.com:22 on local port 2222 and pass -o HostKeyAlias=deploy.example.com so OpenSSH verifies the real host key in known_hosts:
prontaro forward 2222 deploy.example.com:22 --ip 203.0.113.10 &
FWD_PID=$!
trap 'kill "$FWD_PID" 2>/dev/null || true' EXIT
for i in $(seq 1 30); do
if nc -z 127.0.0.1 2222; then break; fi
sleep 0.5
done
ssh -p 2222 -o HostKeyAlias=deploy.example.com -o StrictHostKeyChecking=yes \
deploy@127.0.0.1 "cd /srv/app && ./deploy.sh"Common errors
| Symptom | Cause | Fix |
|---|---|---|
Empty PRONTARO_PROXY_URL or PRONTARO_KEY |
Variable is marked Protected and the job ran on an unprotected branch. | Run on a protected branch or update Protected branches / tags. |
407 Proxy Authentication Required |
Wrong password, a $ character in the secret mangled by Expand variable reference, or new credentials are still propagating. |
Uncheck Expand variable reference, re-copy the URL, and retry after a few seconds. |
403 target_denied |
Destination host or port is missing from the To list. | Add host:port under To in the credentials’ Access tab in IP addresses. |
You have 2 addresses — choose which one to go out from |
Account has multiple IPs on Pro and --ip was omitted in CI. |
Pass --ip <your-IP> to prontaro forward. |
| Job hangs after migration succeeds | Background prontaro forward was not terminated on exit. |
Add `trap ’kill “$FWD_PID” 2>/dev/null |
Next steps
- Security, TLS, and production checklist — target allowlists, secret rotation, and production hardening for outbound traffic.
- Local port forwarding (
prontaro forward) — outbound TCP connections to databases and SSH servers without SOCKS5. - HTTP & SOCKS5 proxy — proxy credentials, destination rules, and password rotation.
- Static IP in GitHub Actions — setting up proxy credentials, Relay URLs, and
prontaro forwardin GitHub workflows.
Related guides
- HTTP & SOCKS5 proxyRoute outbound HTTP, HTTPS, and TCP connections through your static IPv4 with one proxy credential set, end-to-end TLS, and From/To rules.
- Relay URLsCall IP-allowlisted HTTPS APIs from edge runtimes and no-code tools without proxy configuration by replacing the base URL with a Prontaro Relay URL.
- Local port forwarding (prontaro forward)Connect database drivers, SFTP clients, and CLI tools to remote servers from your static IPv4 over a local TCP port — no proxy support needed.
Something wrong on this page? Contact us