Skip to main content

GitLab Application Guide

GitLab provides Git repository hosting, CI/CD pipelines, issue tracking, and a container registry in one application.

Status: Available (not yet verified end to end)


Quick Reference​

PropertyValue
Application IDgitlab
CategoryCI/CD
Default Imagegitlab/gitlab-ce:19.4.2-ce.0
Application Port80
SSH Port22 (optional, see below)
Default CPU2048 (Fargate)
Default Memory4096 MB (Fargate)
Default Instancet3.medium (EC2)
Health Check Path/users/sign_in
Health Check Grace900 seconds (application default)
Supports FargateYes
Supports EC2Yes
Supported Auth Modesapplication-oidc (default), alb-oidc, none
Database RequiredYes (PostgreSQL)

Upstream Features​

  • Git repository hosting and merge requests
  • CI/CD pipelines (runners are deployed separately)
  • Container and package registries
  • Issues, wikis, and project management

CloudForge deploys GitLab Community Edition (gitlab/gitlab-ce). Some features require GitLab Premium or Ultimate.


Optional Ports​

PortProtocolDirectionFeature FlagDescription
22TCPInboundenableSshGit SSH
5050TCPInboundenableRegistryContainer Registry
9090TCPInboundenableMetricsPrometheus Metrics

enableRegistry is not a recognized deployment-context key, so port 5050 cannot currently be opened through the deployment context.

Example:

{
"enableSsh": true,
"enableMetrics": true
}

Database Requirements​

GitLab requires a PostgreSQL database. The interactive deployer and CloudForgeDeployment enable provisionDatabase automatically when it is not set. If a context is synthesized without it, GitLab falls back to the image's embedded PostgreSQL, which is suitable only for a single development instance.

PropertyValue
EnginePostgreSQL 17 or later (17 is the default; a higher version may be chosen with databaseVersion, a lower one is rejected)
Instance Classdb.t3.medium (default)
Storage50 GB (default)
Database Namegitlabhq_production
Backup Retention30 days

Database parameters include max_connections=300, shared_buffers={DBInstanceClassMemory/4096}, effective_cache_size={DBInstanceClassMemory*3/4096}, work_mem=16MB, maintenance_work_mem=256MB, and random_page_cost=1.1.


Authentication​

Supported Auth Modes​

ModeDescription
application-oidcGitLab signs users in through OmniAuth OpenID Connect (default)
alb-oidcThe load balancer authenticates users before requests reach GitLab
noneGitLab local accounts only

OIDC Integration Details​

With application-oidc, CloudForge adds an OmniAuth openid_connect provider to GITLAB_OMNIBUS_CONFIG:

  • Users are created on first sign-in (omniauth_block_auto_created_users = false) and linked to existing accounts by email (omniauth_auto_link_user).
  • PKCE is enabled according to the OIDC provider configuration.
  • Group synchronization and admin-role assignment are not configured. Grant administrator rights with the GitLab Rails console or the admin UI.

Callback Path: /users/auth/openid_connect/callback


Environment Variables​

CloudForge configures GitLab through the GITLAB_OMNIBUS_CONFIG environment variable:

SettingDescription
external_urlExternal URL
nginx['listen_port']80
nginx['listen_https']false (TLS terminates at the load balancer)
nginx['real_ip_*'], nginx['proxy_set_headers']Trust X-Forwarded-* headers from private address ranges
gitlab_rails['monitoring_whitelist']['0.0.0.0/0', '::/0']
postgresql['enable']false when an RDS database is provisioned, otherwise true
gitlab_rails['db_*']RDS connection settings; the password is read from GITLAB_DATABASE_PASSWORD, injected from Secrets Manager
redis['enable']true (embedded Redis)

Storage Configuration​

Container (Fargate)​

PropertyValue
Data Path/var/opt/gitlab
EFS Path/gitlab
Volume NamegitlabData
Container UserNot set (the image runs as root)
EFS Permissions755

EC2​

PropertyValue
EBS Device/dev/xvdh
Data Path/var/opt/gitlab
Log Paths/var/log/gitlab/gitlab-rails/production.log, /var/log/gitlab/gitlab-rails/api_json.log, /var/log/gitlab/puma/puma_stderr.log, /var/log/userdata.log

Deployment Context Examples​

Development​

{
"stackName": "GitLab-Dev",
"applicationId": "gitlab",
"applicationName": "GitLab Dev",
"environment": "dev",

"runtime": "fargate",
"securityProfile": "dev",
"topology": "application-service",

"networkMode": "public",
"region": "us-east-1",

"authMode": "none",

"cpu": 2048,
"memory": 4096,

"enableMonitoring": true,
"logRetentionDays": "7",
"healthCheckGracePeriod": 900
}

Development with Database, SSH, and OIDC​

{
"stackName": "GitLab-Dev-Full",
"applicationId": "gitlab",
"applicationName": "GitLab Dev",
"environment": "dev",

"runtime": "fargate",
"securityProfile": "dev",
"topology": "application-service",

"domain": "dev.example.com",
"subdomain": "gitlab",
"enableSsl": true,

"networkMode": "private-with-nat",
"region": "us-east-1",

"authMode": "application-oidc",
"cognitoAutoProvision": true,
"cognitoDomainPrefix": "gitlab-dev-yourcompany",

"cpu": 2048,
"memory": 4096,

"provisionDatabase": true,
"databaseEngine": "postgres",
"databaseVersion": "16",
"databaseInstanceClass": "db.t3.medium",
"databaseAllocatedStorageGB": 50,
"databaseName": "gitlabhq_production",

"enableSsh": true,

"enableMonitoring": true,
"logRetentionDays": "30",
"healthCheckGracePeriod": 900
}

Production​

Repository data and the embedded Redis are local to each instance, so run a single instance.

{
"stackName": "GitLab-Production",
"applicationId": "gitlab",
"applicationName": "GitLab",
"environment": "prod",

"runtime": "ec2",
"securityProfile": "production",
"topology": "application-service",

"domain": "example.com",
"subdomain": "gitlab",
"enableSsl": true,

"networkMode": "private-with-nat",
"region": "us-east-1",

"authMode": "application-oidc",
"cognitoAutoProvision": true,
"cognitoDomainPrefix": "gitlab-prod-yourcompany",
"cognitoMfaEnabled": true,
"cognitoMfaMethod": "totp",

"instanceType": "t3.large",
"minInstanceCapacity": 1,
"maxInstanceCapacity": 1,

"provisionDatabase": true,
"databaseEngine": "postgres",
"databaseVersion": "16",
"databaseInstanceClass": "db.t3.large",
"databaseAllocatedStorageGB": 100,
"databaseMultiAz": true,
"databaseName": "gitlabhq_production",
"databaseBackupRetentionDays": 30,

"enableSsh": true,
"enableMetrics": true,

"complianceFrameworks": "SOC2",
"awsConfigEnabled": true,
"guardDutyEnabled": true,
"auditManagerEnabled": true,
"wafEnabled": true,
"albAccessLogging": true,
"enableFlowlogs": true,

"enableMonitoring": true,
"enableEncryption": true,
"logRetentionDays": "730",
"retainStorage": true,
"healthCheckGracePeriod": 900
}

Health Check Configuration​

PropertyDefaultDescription
Path/users/sign_inHealth check endpoint
Grace Period900 secondsGitLab's application default, to allow for database migrations
Interval30 secondsTime between checks
Timeout5 secondsResponse timeout

GitLab's first start runs database migrations and service initialization, so its default grace period is 900 seconds rather than the usual 300. Setting healthCheckGracePeriod overrides it.


Compliance Considerations​

Setting complianceFrameworks enables CloudForge's infrastructure controls and validation rules for those frameworks. It does not certify the deployment.

SOC 2​

Controls you configure in GitLab:

  • Audit events
  • Secret scanning
  • Protected branches and required approvals
  • Signed commits
  • Session timeouts
  • Two-factor authentication

GDPR​

Controls you configure in GitLab and your processes:

  • Consent for profile data
  • Data export
  • Erasure procedures

Post-Deployment Tasks​

1. Initial Login​

  1. Open https://gitlab.example.com (your configured FQDN).
  2. Sign in as root. Recent GitLab images generate the initial password in /etc/gitlab/initial_root_password inside the container.
  3. With application-oidc, sign in through OIDC and grant administrator rights to the appropriate users.

2. Configure Container Registry​

CloudForge does not configure GitLab's container registry. To use it, set registry_external_url and a storage backend (for example S3) in the Omnibus configuration.

3. Configure CI/CD Runners​

  1. Go to Admin > CI/CD > Runners.
  2. Register a GitLab Runner.
  3. Configure its executor (for example Docker or Kubernetes).

Troubleshooting​

GitLab takes too long to start​

The first start can take 10 to 15 minutes for database migrations and service initialization.

Monitor /var/log/gitlab/gitlab-rails/production.log.

Container Registry not accessible​

  1. Confirm the registry is configured in the Omnibus configuration.
  2. Check that the security group allows port 5050 (see Optional Ports).
  3. Verify DNS resolution.