Skip to content
Sections

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.

NeedsDedicated$12/mo$15A dedicated IP for your integrationsGet a dedicated IP

First payment refunded within 7 days if it doesn’t work for you

GitLab CIHTTP / SOCKS5 / Relay
Static IPdedicated, only yours
  • Partner API
  • External DB
External API or database allowlisting your IP
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

  1. Open IP addresses in my.prontaro.com, pick your IP, and click Create proxy credentials.
  2. Name them gitlab-ci and copy the https:// connection string on port :443.
IP addressesProxy credentialsOpen in dashboard

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*).

ProjectSettingsCI/CDVariables
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:

yaml
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.org

Run 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.10

Step 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.

  1. Open the gitlab-ci credentials under IP addresses in my.prontaro.com and switch to the Access tab.
  2. Under To, add the required host:port entries (for example api.example.com:443) and save.
IP addressesProxy credentialsAccessOpen in dashboard

Path A. API calls without installing the CLI

Pass PRONTARO_PROXY_URL only to the commands that need your static IP:

yaml
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/sync

Path 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.

yaml
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.sql

For 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:

bash
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

Contact us

Enter your email so we can reply.Enter a valid email, e.g. name@company.example.
Tell us what you need or what went wrong.up to 2,000 characters

Sent! We’ll reply to .

Or email us at support@prontaro.com