{"id":24017445,"url":"https://github.com/mattyboy84/aws-ec2-gitlab-instance","last_synced_at":"2026-05-16T03:33:11.939Z","repository":{"id":176796953,"uuid":"594474660","full_name":"mattyboy84/AWS-EC2-Gitlab-Instance","owner":"mattyboy84","description":"A Self hosted Gitlab application hosted on an EC2 instance in front of an ALB. Includes support for domain configuration with Route53 \u0026 regular backups into an S3 bucket","archived":false,"fork":false,"pushed_at":"2023-06-24T15:33:39.000Z","size":277,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T09:18:10.710Z","etag":null,"topics":["aws","ec2","gitlab","networking","portfolio"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattyboy84.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-28T17:04:29.000Z","updated_at":"2023-07-16T09:51:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"70e22457-a20b-411d-a69d-39449a10f5fe","html_url":"https://github.com/mattyboy84/AWS-EC2-Gitlab-Instance","commit_stats":null,"previous_names":["mattyboy84/aws-ec2-gitlab-instance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattyboy84%2FAWS-EC2-Gitlab-Instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattyboy84%2FAWS-EC2-Gitlab-Instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattyboy84%2FAWS-EC2-Gitlab-Instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattyboy84%2FAWS-EC2-Gitlab-Instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattyboy84","download_url":"https://codeload.github.com/mattyboy84/AWS-EC2-Gitlab-Instance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240739992,"owners_count":19849864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","ec2","gitlab","networking","portfolio"],"created_at":"2025-01-08T09:18:15.326Z","updated_at":"2026-05-16T03:33:06.917Z","avatar_url":"https://github.com/mattyboy84.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# EC2-Gitlab-Instance\n\n![](images/diagram.png)\n\n\n---\n\n# Instance:\n - ImageId: ami-084e8c05825742534 (eu-west-2)\n - InstanceType: t2.medium\n\n---\n\n## Setup:\n1. deploy the template to cloudformation\n2. enter the parameters\n![](images/stack-parameters.png)\n3. configuration with a domain:\n   1. including the `hostedZoneId`, `domainName`, `subDomainName` \u0026 `domainCertArn` parameters will:\n      1. Create a HTTPS loadbalancer targetGroup \u0026 listener with the `domainCertArn` on port 443\n      2. Create a dns record in the `hostedZoneId` for `subDomainName.domainName` e.g. `gitlab.example.co.uk`\n      3. Configure the gitlab instance for the domain `subDomainName.domainName`\n   2. not including the `hostedZoneId`, `domainName`, `subDomainName` \u0026 `domainCertArn` parameters will:\n      1. Omit the HTTPS loadbalancer targetGroup \u0026 listener\n      2. Not create any dns records\n      3. Configure the gitlab instance to be accessible from the loadbalancer e.g. `{loadBalancerName}-1234567890.AWS::Region.elb.amazonaws.com`\n4. Give time for the instance to create, it will be accessible from the dns record or the public ELB domain\n\n![](images/loginScreen.png)\n\n\n# Notes\nQ: Why is a load balancer needed?\nA: The Gitlab CE installation creates \u0026 signs its own HTTPS certificate which some browsers warn about when trying to access the site. The load balancer allows port 443 to be listened on \u0026 inject your domain certificate when using HTTPS to resolve this issue.\n\nQ: How do backups work?\nA: The gitlab.rb file is configured to send the `Gitlab backup`, the `gitlab.rb` file \u0026 `gitlab-secrets.json`. A backup will occur everyday at 00:00. A backup can also be preform by running the preform-backup SSM document.\n\nThe default username is `root` \u0026 the userData script sets the password to `gitlabRootPassword` stack parameter, The default being `Password123!`\n\n---\n\n# Self-Managed Gitlab CE\nOnce you finish setting up Gitlab CE you can login, create groups \u0026 repos without issue. You can even clone them locally (setup ssh), add files then push them back to your Gitlab. Additionally, You can also register your own runners on a global or group level [check this out](https://github.com/mattyboy84/AWS-EC2-Gitlab-runner-fleet). These runners can then create resources in aws using a template.yaml \u0026 gitlab-ci.yaml.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattyboy84%2Faws-ec2-gitlab-instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattyboy84%2Faws-ec2-gitlab-instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattyboy84%2Faws-ec2-gitlab-instance/lists"}