---
# System prepended metadata

title: Gerrit Setup

---

# Gerrit Setup
1. To Pull Gerrit docker image
```shell=
docker pull gerritcodereview/gerrit:3.3.2-ubuntu20
```
2. To create the folders, git, db, index, cache, etc, for docker container
```shell=
mkdir git db index cache etc
```
3. execute the run-gerrit.sh to setup container for using
```shell=
./run-gerrit.sh
```
Note. run-gerrit.sh
```shell=
#!/bin/bash -e

DICT_PATH=/home/nol/nol-services/gerrit

GIT_PATH=$DICT_PATH/git
DB_PATH=$DICT_PATH/db
INDEX_PATH=$DICT_PATH/index
CACHE_PATH=$DICT_PATH/cache
ETC_PATH=$DICT_PATH/etc

docker run -ti -p 80:8080 -p 29418:29418 \
       --name gerrit-service \
       --hostname gerrit-service \
       -v $GIT_PATH:/var/gerrit/git \
       -v $DB_PATH:/var/gerrit/db \
       -v $INDEX_PATH:/var/gerrit/index \
       -v $CACHE_PATH:/var/gerrit/cache \
       -v $ETC_PATH:/var/gerrit/etc \
       --env CANONICAL_WEB_URL=http://localhost \
       gerritcodereview/gerrit

```