Skip to content

Commit c939261

Browse files
committed
docker getting started: explicit warning about /var/lib/crowdsec/data being required as a volume
1 parent f4e345c commit c939261

File tree

1 file changed

+25
-17
lines changed
  • crowdsec-docs/unversioned/getting_started/installation

1 file changed

+25
-17
lines changed

crowdsec-docs/unversioned/getting_started/installation/docker.mdx

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ pagination_next: getting_started/health_check
1111
Prerequisites are written for bare metal installations. Please keep in mind the containerization layer may make some of these items unnecessary.
1212
:::
1313

14+
:::warning
15+
Since CrowdSec 1.7.0, it is mandatory to persist the `/var/lib/crowdsec/data` directory in a volume.
16+
17+
If you use the examples provided in this page, they will be.
18+
19+
If you choose to write your own compose file, make sure create a volume for it.
20+
21+
:::
22+
1423
Before getting started, it is advised to read the [introduction](/unversioned/getting_started/introduction.mdx) page to understand the prerequisites and concepts for running CrowdSec.
1524

1625
## Docker
@@ -50,7 +59,7 @@ crowdsec:
5059
COLLECTIONS: "crowdsecurity/nginx"
5160
GID: "${GID-1000}"
5261
depends_on:
53-
- 'reverse-proxy'
62+
- "reverse-proxy"
5463
volumes:
5564
- ./crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml
5665
- logs:/var/log/nginx
@@ -59,7 +68,7 @@ crowdsec:
5968
```
6069
6170
:::info
62-
`Compose` snippet was taken from our [example-docker-compose repository](https://github.com/crowdsecurity/example-docker-compose) which contains many examples of how CrowdSec container can be used in different setups.
71+
`Compose` snippet was taken from our [example-docker-compose repository](https://github.com/crowdsecurity/example-docker-compose) which contains many examples of how CrowdSec container can be used in different setups.
6372
:::
6473

6574
#### Compose key aspects
@@ -77,7 +86,7 @@ volumes:
7786

7887
##### Persistent Data Directories
7988

80-
We recommend persisting the following directories:
89+
The following directories _must_ be persisted, otherwise the container will refuse to start:
8190

8291
```yaml
8392
volumes:
@@ -91,11 +100,11 @@ If you haven't used named volumes within Docker before you can read their [docum
91100

92101
##### Depends On
93102

94-
Depends on directive allows Docker to bring up the compose stack in "order", the reason we use it within the snippet the container `reverse-proxy` creates the log files on startup and we want to make sure CrowdSec finds these files to monitor.
103+
Depends on directive allows Docker to bring up the compose stack in "order", the reason we use it within the snippet the container `reverse-proxy` creates the log files on startup and we want to make sure CrowdSec finds these files to monitor.
95104

96105
```yaml
97106
depends_on:
98-
- 'reverse-proxy'
107+
- "reverse-proxy"
99108
```
100109

101110
## Environment Variables
@@ -104,25 +113,24 @@ You can find a full list of available environment variables on our [Docker Hub i
104113

105114
Here are the most common environment variables for customizing CrowdSec in Docker:
106115

107-
| Variable | Default | Description |
108-
|---------------------|-----------------------------|-------------|
109-
| `COLLECTIONS` | *(none)* | Space-separated list of CrowdSec collections to install (e.g., `crowdsecurity/nginx`). |
110-
| `TZ` | UTC | Timezone for logs (e.g., `Europe/London`). |
111-
| `CONFIG_FILE` | `/etc/crowdsec/config.yaml` | Path to the main config file. Useful if mounting a single file instead of a full directory. |
112-
| `LOCAL_API_URL` | `http://0.0.0.0:8080` | Where the Local API listens. Normally doesn't need to be changed unless you're running in agent mode. |
113-
| `DISABLE_LOCAL_API` | `false` | Set to `true` to disable LAPI and use this instance as an log processor only. |
114-
| `DISABLE_AGENT` | `false` | Set to `true` to disable the log processor and use this instance as an LAPI only. |
115-
| `AGENT_USERNAME` | *(none)* | Required only if `DISABLE_LOCAL_API` is true. Username for connecting to central LAPI. |
116-
| `AGENT_PASSWORD` | *(none)* | Password for authenticating the agent. |
117-
| `BOUNCER_KEY_<name>`| *(none)* | Seed value as API key for remediation under `<name>` |
116+
| Variable | Default | Description |
117+
| -------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------- |
118+
| `COLLECTIONS` | _(none)_ | Space-separated list of CrowdSec collections to install (e.g., `crowdsecurity/nginx`). |
119+
| `TZ` | UTC | Timezone for logs (e.g., `Europe/London`). |
120+
| `CONFIG_FILE` | `/etc/crowdsec/config.yaml` | Path to the main config file. Useful if mounting a single file instead of a full directory. |
121+
| `LOCAL_API_URL` | `http://0.0.0.0:8080` | Where the Local API listens. Normally doesn't need to be changed unless you're running in agent mode. |
122+
| `DISABLE_LOCAL_API` | `false` | Set to `true` to disable LAPI and use this instance as an log processor only. |
123+
| `DISABLE_AGENT` | `false` | Set to `true` to disable the log processor and use this instance as an LAPI only. |
124+
| `AGENT_USERNAME` | _(none)_ | Required only if `DISABLE_LOCAL_API` is true. Username for connecting to central LAPI. |
125+
| `AGENT_PASSWORD` | _(none)_ | Password for authenticating the agent. |
126+
| `BOUNCER_KEY_<name>` | _(none)_ | Seed value as API key for remediation under `<name>` |
118127

119128
:::tip
120129
Use a `.env` file or Docker secrets to avoid hardcoding sensitive variables like passwords or API keys.
121130
:::
122131

123132
---
124133

125-
126134
## Next Steps?
127135

128136
Great, you now have CrowdSec installed on your system. Within the [post installation steps](/getting_started/next_steps.mdx) you will find the next steps to configure and optimize your installation.

0 commit comments

Comments
 (0)