Skip to main content

How to manage Data

Gitness writes data beneath /data within the running container. It is important to understand where this data is written on the host, to avoid any potential data loss.

When running Gitness on a locally, it is highly recommended to use a bind mount or named volume to avoid potential data loss during system upgrades or reboots.

When running a shared Gitness instance for a development team, you should take extra steps to protect your Gitness data.

Local instance

On MacOS or Linux, create a gitness directory in a safe location:

mkdir $HOME/gitness

Then pass -v $HOME/gitness:/data in your docker run command.

docker run -d \
-p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/gitness:/data \
--name gitness \
--restart always \
harness/gitness

Gitness will now store its data beneath the gitness directory in your home directory.

AWS EC2

Create a separate volume just for your Gitness data. Ensure the volume is an appropriate size for your team and number of repositories.

Create an EBS volume for your Gitness data and mount it at /mnt/gitness-data, then pass -v /mnt/gitness-data:/data in your docker run command.

docker run -d \
-p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /mnt/gitness-data:/data \
--name gitness \
--restart always \
harness/gitness

Gitness will now store its data beneath /mnt/gitness-data on your EC2 instance.

tip

Back up your Gitness EBS volume with automated snapshots. If you need more space in the future, EBS volumes can be expanded.

Kubernetes

The Gitness Helm chart will create a Persistent Volume Claim for the Gitness container's /data directory.

To learn how to manage this volume, contact your Kubernetes administrator. If you are using a managed Kubernetes service, refer to your provider's documentation.