This is the multi-page printable view of this section. .

Return to the regular view of this page.

Deployment & Installation

Choose a CheeseWAF deployment path, prepare the host, and verify the first running service.

Use this page to choose a deployment path. For a fresh Linux server, start with the one-line installer or the verified release archive; systemd remains the path used by the quick start.

One-line installer or verified archive, a shared application root or FHS layout, and a systemd service.

Compose deployment for evaluation or environments already managed by Docker.

CLI, portable archive, or NSIS desktop installation with a local controller.

DMG desktop application or portable command-line archive.

Prepare

ItemMinimum or defaultWhy it matters
Operating systemSupported 64-bit Linux for the recommended pathThe release archive and systemd installer target Linux hosts.
CPU and memory1–2 cores and 2 GB RAM can run the lightweight profileThe setup wizard recommends a conservative profile on small hosts.
DiskSpace for the archive, Web assets, runtime data, and logsKeep runtime data outside the source/template directory.
Privilegeroot or an administrator with sudoThe installer creates the cheesewaf service account and systemd unit.
NetworkAdministration path to 9443; data-plane path to 8080Keep management and business traffic on separate access policies.
BrowserA browser that can reach the management listenerRequired for the Web setup wizard and Console.
Release integrityMatching archive and SHA256SUMS from the official source, with GitHub as the backup download sourceVerify before extracting or running the binary; stop on checksum or signature errors.

The one-line installer enables HTTPS and binds the management listener on all interfaces, then gates first setup with a one-time token and a generated security entry. Restrict 9443 to trusted administration networks before exposing it. The shipped configuration template and the setup wizard default to 0.0.0.0:9443 with server.admin_public: true; a configuration that omits the server keys falls back to the loader default 127.0.0.1:9443. A public listener still requires management TLS, a valid certificate, and a restricted source network.

On small hosts, use the lightweight profile: the setup wizard recommends low when the host has at most 2 logical cores or 2 GB RAM; a probe timeout, cancellation, or failure also falls back to low. storage.profile: production refuses to start until the production wiring is complete and does not silently fall back to SQLite.

Choose an installation mode

  • Setup / single node: the one-line installer, a verified archive with systemd, or Docker. Use this for a first deployment, evaluation, and a small self-hosted service.
  • Deploy / production: Start from the Linux or Docker guide, then add a trusted certificate, an external access policy, backups, log retention, and a tested upgrade path. See Operations.
  • Offline / air-gapped: Download the release archive, checksums, and signed resource packages on a connected machine, transfer them through your approved channel, and follow the offline section of the Linux guide.

Release files

Start with the official CheeseSec website for release downloads. The Linux installer prefers official release metadata and files, with GitHub Releases as the backup for failed downloads. Checksum or signature verification failures stop installation and must not trigger a source switch. Select the artifact that matches the target platform and architecture:

Artifact patternTarget
cheesewaf-amd64-linux-*.tar.gzLinux x86_64
cheesewaf-arm64-linux-*.tar.gzLinux ARM64
cheesewaf-loong64-linux-*.tar.gzLinux LoongArch
cheesewaf-amd64-darwin-* / cheesewaf-arm64-darwin-*macOS Intel / Apple Silicon
cheesewaf-*-windows-*Windows executable, ZIP, or setup package

Every Linux archive must include the cheesewaf binary, web/dist, configs/, the systemd unit, and install-linux.sh. Stop and download the archive again if one of these items is missing.

After installation

  1. Start the service and confirm the process owns the expected listener.
  2. Open the HTTPS setup URL printed by the installer, complete /setup, and create the first administrator.
  3. Add one test site and send test traffic through the data-plane listener.
  4. Keep the management port restricted to trusted administration networks until TLS, access control, backups, and upgrade procedures are verified.

Continue with Quick Start.

1 - Linux Deployment (systemd)

Install CheeseWAF with the one-line installer or an offline release archive, then complete first setup through the HTTPS management entry.

This guide covers Linux physical servers, cloud instances, and virtual machines. The one-line installer asks for a language, detects the CPU architecture, downloads the latest stable release from CheeseSec’s official source first, verifies its checksum, installs the systemd service when systemd is available, and prints the first-setup URLs. GitHub is the backup for failed downloads. Use the offline path when the host has no outbound access.

Summary

TEXT
One-line installer
        ↓
HTTPS setup URL printed by the installer
        ↓
Create the first administrator
        ↓
Verify service, listener, and readiness
        ↓
Onboard one test site

For a host without outbound access: download the archive and SHA256SUMS, verify the checksum, extract the complete package, and run sudo ./install-linux.sh from the package root.

Prepare

ItemRequirement
OS64-bit Linux matching the release artifact: amd64, arm64, or loong64
Resources1–2 cores and 2 GB RAM can run the lightweight setup profile; allocate more for production traffic
Privilegeroot or an administrator with sudo
DiskSpace for the archive, Web assets, runtime data, and logs
AccessA browser that can reach port 9443, possibly through a restricted network or SSH tunnel
FirewallRestrict 9443 to trusted administration networks; open the data-plane port only where business traffic needs it
Toolscurl, tar, sha256sum, systemctl, and ss

1. One-line installation (recommended)

BASH
curl --proto '=https' --proto-redir '=https' -fsSL https://cheesesec.com/install.sh | sudo bash

When already running as root, omit sudo:

BASH
curl --proto '=https' --proto-redir '=https' -fsSL https://cheesesec.com/install.sh | bash

The script reads language, install-root, and entry-name input from /dev/tty, so interactive answers are not consumed as script source. For unattended provisioning, set the documented CHEESEWAF_* environment variables and invoke the downloaded script; never put passwords or setup tokens in shell arguments or history.

Downloads and redirects must use HTTPS. The installer prefers official release metadata and files, and tries GitHub only when an official download fails. A checksum failure or a failed signature verification stops the run before extraction or installation; do not switch sources to bypass a failed check. To verify release provenance as well as the checksum, install a trusted cosign separately and set CHEESEWAF_VERIFY_SIGNATURE=1; verification requires the release workflow identity for the exact selected tag.

GitHub backup entry

If the official install.sh cannot be downloaded, use the GitHub release entry:

BASH
curl --proto '=https' --proto-redir '=https' -fsSL https://github.com/LaokeQwQ/CheeseWAF/releases/latest/download/install-linux.sh | sudo bash

This is a download fallback. It must not be used to retry an installation that stopped on a checksum or signature error.

Select a version or installation directory

To install a specific stable or beta tag, set CHEESEWAF_RELEASE (the v prefix is optional):

BASH
curl --proto '=https' --proto-redir '=https' -fsSL https://cheesesec.com/install.sh \
  | sudo env CHEESEWAF_RELEASE=v0.4.5 bash

During the interactive flow, choose an application install root after selecting the language. Entering /opt/cheesewaf, for example, places the binary, Web assets, runtime configuration, data, and logs under bin/, web/, config/, data/, and logs/ beneath that root. Press Enter to keep the split FHS layout shown below. The systemd unit remains under /etc/systemd/system unless CHEESEWAF_UNIT_DIR is overridden.

For automation, set CHEESEWAF_INSTALL_DIR before invoking the installer. Individual CHEESEWAF_PREFIX, CHEESEWAF_WEB_DIR, CHEESEWAF_CONFIG_DIR, CHEESEWAF_DATA_DIR, and CHEESEWAF_LOG_DIR values take precedence for their respective paths:

BASH
curl --proto '=https' --proto-redir '=https' -fsSL https://cheesesec.com/install.sh \
  | sudo env CHEESEWAF_INSTALL_DIR=/opt/cheesewaf bash

Install roots must be absolute dedicated directories whose path components contain only ASCII letters, digits, ., _, or -; shared system directories and paths containing shell metacharacters are rejected.

The installer will:

  1. Ask for 中文 or English and check Linux, architecture, disk space, curl, tar, sha256sum, awk, and od prerequisites.
  2. Download the selected server archive from the official source first, using GitHub only for failed downloads, and verify its single matching SHA256SUMS entry. When signature verification is enabled, verify the checksum file against the exact release tag. A failed verification stops before installation or service startup.
  3. Install the binary, Web Console, runtime configuration, and systemd unit, then create the non-login cheesewaf service account.
  4. Generate an HTTPS management listener, a one-time setup token, and a security-entry path. The entry path accepts ASCII letters and digits only; a random value is generated by default, and a custom value is accepted only when it passes the same validation.
  5. Start the service when systemd is available, check the listener and health state, and print the version, architecture, installation paths, service state, public management URL, detected private management URLs, token lifetime, and next steps. Without systemd, the files are installed but the service is reported as not started.

Save the complete setup URL printed at the end. On an interactive terminal the installer prints the public setup URL and the security-entry URL, and also prints each detected private-address setup URL. In a non-interactive run, secrets are withheld from stdout and stored in the root-only install-secrets.txt receipt under the configuration directory; set CHEESEWAF_SHOW_SECRETS=1 only when the output is protected. The setup URL envelope expires after 10 minutes. The setup token itself has no timer; it is revoked after the first successful setup or by an explicit reset. Do not paste the complete URL into tickets, screenshots, shell history, or logs.

2. First setup and public entry

Open the https:// URL printed by the installer. The setup URL always uses the fixed /setup path:

TEXT
https://PUBLIC_IP:9443/setup#setup_token=ONE_TIME_TOKEN

ONE_TIME_TOKEN is the one-time bootstrap token. The browser reads the token from the URL fragment, clears it from the address bar, and sends it in the X-CheeseWAF-Setup-Token header. The token is never placed in query parameters, cookies, or localStorage.

After setup completes, open https://PUBLIC_IP:9443/SECURITY_ENTRY. The security entry contains ASCII letters and digits only; it is generated by default or accepted as a validated custom value. The entry endpoint signs an access Cookie and redirects to the login page. Keep the setup route and the post-setup security entry as separate paths.

The management plane uses HTTPS and binds on all interfaces by default for this installation path. The installer writes the detected public host to admin.env; set CHEESEWAF_ADMIN_PUBLIC_HOST when the host has no directly assigned public address, for example behind NAT or a reverse proxy. Restrict security groups, firewalls, and any reverse proxy to trusted administration networks before exposing port 9443 to the Internet. A locally generated certificate may cause a browser warning on first access; replace it with a trusted certificate for production use.

After setup completes, the bootstrap token is invalid. If the URL is lost before an administrator is created, reset it on the host:

BASH
sudo -u cheesewaf /usr/local/bin/cheesewaf \
  --config /etc/cheesewaf/cheesewaf.yaml \
  --data-dir /var/lib/cheesewaf \
  setup token reset --show

The command prints a new URL when --show is set; without it, the URL is written to the protected setup.url file under the data directory. Adjust the paths when the service uses a custom install root. The old URL cannot be recovered.

Running the installer again against an existing configuration performs an upgrade. It keeps the existing listener, TLS settings, sites, policies, and security-entry path; choose the same install root or set the same CHEESEWAF_*_DIR overrides so the intended service is upgraded.

3. Verify

BASH
systemctl is-enabled cheesewaf
systemctl is-active cheesewaf
ss -ltnp | grep ':9443'
curl -kfsS https://127.0.0.1:9443/health/ready
sudo journalctl -u cheesewaf -n 100 --no-pager

Expected result: the service is enabled and active, the expected process owns 9443, and the readiness endpoint returns successfully. Confirm that the version and architecture match the target host. After first setup, add one protected site and configure the data-plane listener from the Console.

Standard paths

PathPurpose
/usr/local/bin/cheesewafMain binary
/usr/local/bin/waf-cliCLI symlink
/usr/share/cheesewaf/webWeb Console assets
/etc/cheesewaf/cheesewaf.yamlRuntime configuration copy
/var/lib/cheesewafLocal database, certificates, setup state, and runtime data
/var/log/cheesewafAccess and audit logs

With CHEESEWAF_INSTALL_DIR=/opt/cheesewaf, the corresponding application paths are /opt/cheesewaf/bin/cheesewaf, /opt/cheesewaf/web, /opt/cheesewaf/config/cheesewaf.yaml, /opt/cheesewaf/data, and /opt/cheesewaf/logs.

4. Offline or manual installation

On a connected machine, prefer the official CheeseSec website to obtain the architecture-specific .tar.gz, SHA256SUMS, and signature files when published. GitHub Releases is the backup download source. Keep every file from the same release, then transfer them to the target host. Verify the files in the download directory, extract the archive, and run the installer from the package root:

BASH
sha256sum --check SHA256SUMS --ignore-missing &&
tar -xzf cheesewaf-*-linux-*.tar.gz &&
cd cheesewaf-*-linux-* &&
sudo ./install-linux.sh

The packaged installer expects the matching cheesewaf, web/dist, configs/, and systemd unit in its working directory; it does not download a release by itself. Do not pipe an arbitrary script from an unverified URL into bash, and do not run the packaged installer outside its extracted package root.

The offline script still asks for the language and entry path locally, generates the setup token, and starts the service. On a host without systemd, copy the binary and web/dist into your process manager’s paths and start the service there. Keep a runtime configuration copy and a dedicated data directory; never edit the tracked configs/cheesewaf.yaml template in place.

Do not use unverified binaries, third-party mirrors, or stale installer scripts. A complete Linux archive contains cheesewaf, Web assets, configuration templates, the systemd unit, and the installer; stop and download the archive again if any item is missing.

Troubleshooting

SymptomCheckAction
cheesewaf binary not foundpwd and ls in the extracted directoryRun the packaged installer from the package root; do not extract only the binary.
web/dist/index.html missingfind web -maxdepth 2 -type fDownload the complete release archive again.
Checksum or signature verification failsCheck the selected release and matching checksum/signature filesStop installation and investigate the mismatch. Do not switch to the backup source or disable verification to continue.
Service exits immediatelysudo journalctl -u cheesewaf -b --no-pagerFix the first validation error; confirm the runtime config is a copy, not the tracked template.
Port 9443 is unreachable remotelyss -ltnp | grep ':9443'Allow 9443 from trusted administration networks in the firewall or security group, and confirm the listener and CHEESEWAF_ADMIN_PUBLIC_HOST.
Setup page loads but initialization failssudo ls -l /etc/cheesewaf/install-secrets.txtUse the setup URL from the receipt, or reset the token with sudo -u cheesewaf /usr/local/bin/cheesewaf --config /etc/cheesewaf/cheesewaf.yaml --data-dir /var/lib/cheesewaf setup token reset --show; never paste the URL into logs or tickets.
Proxy returns 502Check the configured upstream from the Console and test it from the WAF hostConfirm the origin is reachable and that the site points at the data-plane listener, not the management port.
Production storage refuses to startInspect the storage error in journalctlConfigure the required production storage; do not force a local SQLite fallback.

For Docker-specific port and data-volume behavior, use the Docker guide. For backups and upgrades, continue with Operations.

2 - Docker Compose Deployment

Deploy CheeseWAF with Docker Compose supporting read-only root filesystems and unprivileged container security.

This guide covers deploying CheeseWAF on containerized infrastructure. The repository provides a hardened Dockerfile and Compose example; the example builds the image locally. Do not treat cheesewaf:dev as a vendor-signed or registry-published image unless you have separately verified the image provenance. The runtime is configured to run as an unprivileged user (UID 10001) with a read-only root filesystem.

Compose Configuration

Reference deploy/docker/docker-compose.yml:

YAML
services:
  cheesewaf:
    image: cheesewaf:dev
    build:
      context: ../..
      dockerfile: deploy/docker/Dockerfile
    user: "10001:10001"
    restart: unless-stopped
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    tmpfs:
      - /tmp:size=32m,mode=1777,noexec,nosuid,nodev
    ports:
      - "8080:8080"
      - "127.0.0.1:9443:9443"
    volumes:
      - cheesewaf-data:/var/lib/cheesewaf
      - cheesewaf-logs:/var/log/cheesewaf
    healthcheck:
      test: ["CMD", "/usr/local/bin/cheesewaf-entrypoint", "healthcheck"]
      interval: 30s
      timeout: 5s
      retries: 3

volumes:
  cheesewaf-data:
  cheesewaf-logs:

When building locally, ensure the build context points to the root of the CheeseWAF repository so both the frontend (web/) and backend Go modules build successfully. The sample 8080:8080 mapping publishes the data-plane listener on all Docker host interfaces. Put it behind an intentional firewall/reverse-proxy policy, or bind it to a controlled interface; only the admin mapping is loopback-bound by default.

Launching & Initialization

Start the container daemon and view logs:

BASH
docker compose -f deploy/docker/docker-compose.yml up -d
docker compose -f deploy/docker/docker-compose.yml logs -f cheesewaf

On initial startup, the container generates self-signed TLS certificates for the admin API. This Compose file binds the admin port to the Docker host’s loopback interface (127.0.0.1:9443), so open https://127.0.0.1:9443/setup on the Docker host. From another machine, set CHEESEWAF_SSH_TARGET to your SSH target and create a tunnel with ssh -N -L 9443:127.0.0.1:9443 "$CHEESEWAF_SSH_TARGET", then use the same local URL; if you intentionally change the port binding, apply an appropriate access-control policy. You can also run the CLI wizard inside the container:

While first-install setup is pending, the container log never prints the setup token or complete URL. It shows only the base /setup URL, the protected /var/lib/cheesewaf/setup.url path, and an opaque receipt. Read the complete URL from that mode 0600 file within its 10-minute validity period. After setup completes, the token is revoked; expired setup.url files are cleaned up.

BASH
docker compose -f deploy/docker/docker-compose.yml exec -it cheesewaf \
  cheesewaf --config /var/lib/cheesewaf/config/cheesewaf.yaml \
  --data-dir /var/lib/cheesewaf setup

Stopping containers with docker compose -f deploy/docker/docker-compose.yml down safely preserves SQLite data, certificates, and log streams inside the named volumes cheesewaf-data and cheesewaf-logs. If storage.postgresql is configured, it receives external access-log records; the Docker volume still contains the management database for the default storage.profile: temporary. The reserved production profile currently fails closed at startup.

3 - Windows Deployment

Three Windows deployment modes: Single-file CLI, Portable Zip archive, and NSIS graphical installer, plus native Windows Service integration and a loopback-only local controller.

CheeseWAF offers three distribution options for Windows, each utilizing the identical core engine and protection capabilities:

1. Single-File CLI & Native Windows Service

Designed for rapid testing, automated scripts, or native Windows Service hosting:

POWERSHELL
# Start WAF forwarder and management plane interactively
.\cheesewaf.exe serve --config .\data\config\cheesewaf.yaml --data-dir .\data

# Query running daemon status and PID lease
.\cheesewaf.exe status

# Gracefully terminate the running daemon
.\cheesewaf.exe stop

Native Windows Service Awareness

cheesewaf serve includes native Windows Service state machine integration (golang.org/x/sys/windows/svc):

  • When invoked by the Windows Service Control Manager (SCM), the process automatically identifies service mode, seamlessly handling SCM Stop and Shutdown signals with zero external service wrappers (like NSSM or WinSW).
  • The default service name is CheeseWAF.

2. Portable Zip Archive

The portable package bundles default configuration templates and compiled Web Console assets:

  1. Extract cheesewaf-amd64-windows-*.zip to your target directory (e.g., D:\CheeseWAF).
  2. Run terminal setup and start the server:
POWERSHELL
# Run the interactive setup wizard on first launch
.\cheesewaf.exe setup

# Launch the WAF daemon
.\cheesewaf.exe serve --config .\data\config\cheesewaf.yaml --data-dir .\data

When first-install setup is pending, the process log shows only the base /setup URL, the protected data\setup.url path, and an opaque receipt. Read the complete URL from the mode 0600 file within its 10-minute validity period. After setup completes, the token is revoked; expired setup.url files are cleaned up.

3. NSIS Graphical Installer (Recommended)

Ideal for workstation or production servers requiring guided installation and Windows Service registration:

  1. Run the cheesewaf-amd64-windows-*-setup.exe installer (use the arm64 variant on Windows ARM64).
  2. Follow the wizard prompts. The installer registers the CheeseWAF Windows service in manual (start= demand) mode; start or stop it explicitly from the Service Control Manager or with sc.exe.
  3. Upon uninstallation, the data\ directory containing your databases and certificates is retained by default to prevent accidental data loss.

Local Helper Controller (GUI)

cheesewaf-gui is a lightweight browser-based local controller for managing the lifecycle of the underlying service:

  • Network Security: Strictly binds only to the local loopback address 127.0.0.1:17943.
  • Key Features: Service start/stop/restart, status and PID display, direct access to the Web Console, and a shortcut to the configuration directory.
  • Process Model: The controller starts the local cheesewaf serve process when requested; it is not a second management backend.
POWERSHELL
.\cheesewaf-gui.exe --config .\data\config\cheesewaf.yaml --data-dir .\data

Once started, open http://127.0.0.1:17943/ in your browser to view the local desktop controller dashboard.

4 - macOS Deployment

Install CheeseWAF on macOS via graphical DMG package or lightweight tar.gz command-line archive.

CheeseWAF supports two primary deployment mechanisms on macOS:

1. DMG Graphical Installer

Ideal for local testing, development, and desktop workstations:

  1. Download the DMG matching your CPU architecture: cheesewaf-arm64-darwin-*.dmg for Apple Silicon (M-series), or cheesewaf-amd64-darwin-*.dmg for Intel Macs.
  2. Open the DMG image and drag CheeseWAF into your Applications folder.
  3. Launch CheeseWAF from Launchpad or Spotlight.

Gatekeeper Guidance: A release is signed and notarized only when the build has a Developer ID identity and Apple notarization credentials. The packaging script intentionally falls back to ad-hoc signing without notarization when those credentials are unavailable. Verify the exact downloaded artifact with its published signature metadata before deployment. For an ad-hoc developer build that triggers macOS security prompts, Control-click the app icon, select “Open”, and confirm the prompt.

Upon launching, the DMG application runs a lightweight browser-based local controller bound to loopback at http://127.0.0.1:17943/. It provides process start/stop/restart controls, status monitoring, and shortcuts to the Web Console and configuration directory. Default runtime data is saved under ~/Library/Application Support/CheeseWAF.

2. Command-Line Archive (tar.gz)

Ideal for headless servers, developer terminal workflows, or automated scripts:

BASH
# Extract the archive
tar -xzf cheesewaf-arm64-darwin-*.tar.gz
cd cheesewaf-*

# Run terminal setup wizard
./cheesewaf setup

# Launch the WAF daemon
./cheesewaf serve --config ./data/config/cheesewaf.yaml --data-dir ./data

If first-install Web setup is still pending, process output shows only the base /setup URL, the protected data/setup.url path, and an opaque receipt. Read the complete URL from the mode 0600 file within its 10-minute validity period. After setup completes, the token is revoked; expired setup.url files are cleaned up.

Once initialized, navigate to http://127.0.0.1:9443/ to log into the Web Console.