Installing Docker and GitLab on Alibaba Cloud Linux 7.4
This guide walks through preparing an Alibaba Cloud ECS Linux 7.4 instance, installing Docker CE, verifying the installation with a hello‑world container, pulling the GitLab CE image, configuring and running the GitLab container, and troubleshooting common issues such as port conflicts and memory limits.
This article explains how to set up a Docker environment and deploy a GitLab CE container on an Alibaba Cloud ECS server running Linux 7.4.
Required environment and software : an ECS instance (recommended 4 GB RAM), Docker CE, and the GitLab Docker image.
1. Install Docker CE
1.1 Uninstall old Docker packages:
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine1.2 Install required utilities:
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm21.3 Add the stable Docker repository:
$ sudo yum-config-manager \
--add-repo https://download.docker.com/linux/centos/docker-ce.repo1.4 Enable edge and test repositories (optional):
$ sudo yum-config-manager --enable docker-ce-edge<br/>$ sudo yum-config-manager --enable docker-ce-test1.5 Install Docker CE: $ sudo yum install docker-ce 1.6 Start Docker: $ sudo systemctl start docker 1.7 Run the hello‑world image to verify the installation: $ sudo docker run hello-world 1.8 Check that Docker is running correctly: $ sudo docker ps -a Successful output confirms Docker is installed and operational.
2. Install and start the GitLab container
2.1 Open required ports (80, 2222, 8443, 9999) in the ECS security group.
2.2 Pull the GitLab CE image: $ sudo docker pull gitlab/gitlab-ce 2.3 Run the GitLab container with appropriate volume mappings and port publishing:
$ GITLAB_HOME=`pwd`/usr/local/gitlab<br/>docker run -d \
--hostname gitlab \
--publish 8443:443 --publish 80:80 --publish 2222:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
gitlab/gitlab-ce2.4 Wait a few minutes for the container to start, then verify with: $ sudo docker ps -a 2.5 Edit the GitLab configuration file inside the container: sudo docker exec -t -i gitlab vim /etc/gitlab/gitlab.rb Set the external URL and change the Unicorn port, e.g.:
external_url 'http://yourIp'
unicorn['port'] = 99992.6 Restart the container to apply changes: $ sudo docker restart gitlab 2.7 Access the GitLab web UI at http://yourIp/, set the initial root password, and log in.
2.8 Login credentials:
Username: root<br/>Password: (the password you set during initialization)3. Common issues and solutions
• 502 errors after container start are often caused by port 8080 being occupied (the guide uses port 9999) or insufficient memory; upgrading the server’s CPU/RAM helps.
• High CPU usage (up to 98%) may occur due to GitLab’s resource demands; be patient during startup.
Overall, the tutorial provides a step‑by‑step procedure for deploying Docker and GitLab on an Alibaba Cloud Linux server, suitable for testing or personal use but not recommended for production without hardware upgrades.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Architect Essentials
Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
