# GitLab CI setups Since not all of us can get access to gitlab freely, because of many reasons, like money or political situation, to train this skill you should install your own local instance of gitlab first. To do so you can use your own lab-server(local or vps), I preferred to use local Ubuntu lab on my PC via VirtualBox. ### Recomended resources for GitLab - 4-8 Gib of RAM - 2 CPU cores - 30 Gib free space (I gave to Lab about 45 Gibs) ## Instalation **Make sure you have Docker installed on the server !!!** `https://docs.docker.com/engine/install/ubuntu/` **Make sure you've done port forwarding !!!** `Machine -> Network -> Port Forwarding -> + ADD NEW -> Name: Gitlab; Protocol: TCP; Host port: 85; Guest port: 85 -> OK` Install GitLab: ```bash sudo docker run --detach \ --hostname gitlab.local \ --publish 443:443 \ --publish 85:80 \ --publish 2223:22 \ --name gitlab \ --restart always \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest ``` Check if port 85 is being listened `sudo ss -tulpn | grep :85` ***Wait for a while till GitLab complete installation*** Then get new password ```bash sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password ``` **Copy this password and save - we'll need it very soon** ## Enter the system - `In browser:` http://localhost:85 - `login:` root - `password:` password you got ## Next step is sync **First of all we need to create Personal Access Token AND SAVE IT** - `Your avatar(click) -> Edit Profile -> (Left sidebar) Access -> Personal access tokens -> Generate token -> Legacy token (more than enough)` I'm gonna use IDE of JetBrains(Win10): - `File -> Settings -> Version Control -> GitLab` - Server: http://localhost:85 - Token: token you've just got ## CI/CD Setups