<!-- HILSTER dashboard 1.3.1 -->
**Dashboard 1.3.1** · [HTML](../deployment.html) · [Complete PDF manual](../_downloads/dashboard-1.3.1.pdf)

# Deployment

The Dashboard server is designed to be run as a number of Docker containers using Docker Compose.

All files needed for deployment are located on our
[GitHub](https://github.com/hilstertestingsolutions/dashboard-deployment).

Clone the repository with:

```bash
git clone https://github.com/hilstertestingsolutions/dashboard-deployment.git
```

Navigate to the folder containing the `docker-compose.yml`.
Edit `docker-compose.yml` according to your needs.

#### WARNING
By default the activation key for the [community license](licensing.md#community-license) is used.
If you need a commercial license for your Dashboard, please [contact us](mailto:support@hilster.io)
to get one.

## Running Dashboard

Start the Dashboard server using:

```bash
docker compose up
```

This will collect all the necessary containers from Dockerhub and start the Dashboard server.

## Running a Specific Dashboard Version

To run a specific Dashboard version, modify the following line in `docker-compose.yml` by replacing
`latest` with your desired version.

```default
image: hilster/dashboard:latest
```

For example, to run `Dashboard-1.2.5` use:

```default
image: hilster/dashboard:1.2.5
```

## Update Dashboard

To use the to the newest version of Dashboard, run

```bash
docker compose pull
```

## Authentication

On the initial run with an empty database, a user `root` with password `root`
is created automatically.

You should immediately [change the password](command-line-interface.md#passwd) using the
[command line interface](command-line-interface.md#cli) by running

```bash
dashboard -u root -p root https://dashboard.server passwd
```

Read the [command line interface documentation](command-line-interface.md#cli) to
learn how to add other users, projects and roles.

Learn [how to reset root’s password](security.md#id1).

## Projects, Users and Roles

You can [create projects](command-line-interface.md#create-project)  and [users](command-line-interface.md#add-user) in the
Dashboard, and  [assign roles for users in those projects](command-line-interface.md#set-roles).
The available roles are `user` and `admin`.

Users with the role `user` can view all data of projects the role is applied for,
but they’re not allowed to upload requirements, delete reports or manage tokens.

Users with the `admin` role have full access to a project.

## Systemd

On Linux `systemd` is a popular daemon to start and stop services.

To run Dashboard as a systemd service, create and edit `dashboard.service` to fit your needs.

```ini
[Unit]
Description=Dashboard
Requires=docker.service
After=docker.service

[Service]
WorkingDirectory=/services/dashboard
ExecStart=/usr/bin/docker compose up
ExecStop=/usr/bin/docker compose down
TimeoutStartSec=0
Restart=always
RestartSec=20s

[Install]
WantedBy=multi-user.target
```

To install the service, run

```bash
cp dashboard.service /etc/systemd/system/dashboard.service
systemctl daemon-reload
systemctl enable dashboard.service
service dashboard start
```

To view logs of Dashboard running as a service, use

```bash
journalctl -u dashboard.service -f
```

## Workers

The number of workers for the front-end and back-end can be altered in `dashboard/dashboard.yml`
by changing `workers` to an appropriate value.

In the back-end, a value of `workers: 0` means that one worker is started per cpu.
All other positive integer numbers state the actual number of processes to be started.

## Proxy

`nginx` is used as a proxy server. You can change `nginx/default.conf` to meet your needs, e.g. add
SSL certificates, etc.

## Backup

To create a backup of the Dashboard database, run the following command while the server is running:

```bash
./backup_database.sh
```

or manually

```bash
docker compose exec mongodb mongodump
```

The database contents will be dumped to the `data/dump` folder.

## Restore

To restore the Dashboard database from a backup, run the following command while the server is running:

```bash
./restore_database.sh
```

or manually

```bash
docker compose exec mongodb mongorestore
```

The database contents will be restored from the `data/dump` folder.
