# Docker standalone

{% hint style="danger" %}
Our Docker images are currently in BETA and are not production-ready, even though the WriteBackExtreme application is a production product.
{% endhint %}

First we need to create a Docker volume so we can make the configuration file, SQLite database and logs persistent.

```bash
docker volume create writeback_data
```

Via this method it can be as easy as running the following command

```bash
docker run -it --pull always \
    -v writeback_data:/app_data \
    -p 8899:8090 \
    --name writeback-extreme \
    -e "WBE_LICENSE=..your license here.." \
    -e "WBE_URL=localhost:8899" \
    ghcr.io/appsfortableau/writeback-extreme:latest
```

> Don't forget to change the `WBE_URL` to a proper external URL. Current given domain is a example.

```bash
# --pull always will download latest image of `appsfortableau/writeback-extreme:latest`
# -d to detatch command to back, run command in the background.
```

Change `latest` into one of the following to get more control over the version: e.g. `4` or `4.1` or full version `4.2.1`

{% hint style="info" %}
Check out our GitHub [package](https://github.com/orgs/appsfortableau/packages/container/package/writeback-extreme) to find the latest version.
{% endhint %}

Once the container is running, open the URL (e.g. above: `http://localhost:8899`) in your browser and click on "Go to the backend."&#x20;

Credentials for the initial administrator user will be shown in the command!

### After stopping the container

(Re)Start the container after closing the command can done via:

```bash
# start previous ran docker container:
docker start writeback-extreme
```

{% hint style="info" %}
Note: the `docker start` command only works with named (via `--name` in the `docker run` command) containers, otherwise you have to look up the container ID with `docker containers` command.
{% endhint %}

#### Changing accessible port

By default port `8090` is exposed. In certain scenario's port `8090` is not available, the port can be change via the `docker run` command by adding `-p {port}:8090`. Where in port 8090 is the internal application port. Replace `{port}` with the desire port.

{% hint style="info" %}
Read more about port forwarding for Docker containers [here](https://docs.docker.com/reference/cli/docker/container/run/#publish).
{% endhint %}

### Changing repository database and/or generate configuration file

To install the application from scratch, run the `installer` command on the binary. Since the application binary is referenced in the `Dockerfile` entrypoint, you can do this easily by:

```bash
docker run -it -p {custom port}:{custom port} \
    -v $PWD:/app_data \
    --name writeback-extreme \
    ghcr.io/appsfortableau/writeback-extreme:latest \
    installer --port {custom port}
```

If you have added the `-v` flag (volume mounting) in the command, you'll have a properly generated `wbe.config.yaml`, and it is no longer necessary to pass a value in the `WBE_LICENSE` and `WBE_URL` variables. The `wbe.config.yaml` does not contain the environment variable replacement values due to being overwritten during the installation process.

### Update WriteBackExtreme container with a new version

If a new version is available, run the following commands to update:

<pre class="language-bash"><code class="lang-bash"><strong>docker pull ghrc.io/appsfortableau/writeback-extreme:latest
</strong># or when having a targetted version to only fetch patches
docker pull ghrc.io/appsfortableau/writeback-extreme:4.2
# Stop docker container from running
docker stop writeback-extreme
# start docker container
docker rm writeback-extreme
</code></pre>

{% hint style="info" %}
All available image versions can be found [here](https://github.com/appsfortableau/writeback-extreme/pkgs/container/writeback-extreme).
{% endhint %}
