ES
EUR
Edición gratuitaGratuito Instalar

Linux (Debian, Ubuntu)

The commands for Debian and Ubuntu: prepare the system, run the one-line installer, open the ufw firewall, check the services, upgrade and uninstall.

All ways to install

La versión que se instala

La versión pública es una versión de desarrollo, llamada 0.3.0-dev. Su nombre no cambia: cada publicación sustituye a la anterior y un identificador de compilación distingue dos compilaciones. Todavía no existe ninguna versión estable: solo se publicará cuando cada sistema y cada paquete se hayan probado de extremo a extremo. Por eso, los comandos de esta página instalan desde el canal dev. Una versión de desarrollo puede contener errores: pruébela en un sitio de prueba antes de confiar en ella.

At a glance

  • Debian 11 and later, Ubuntu 20.04 and later, amd64 and arm64. systemd 239 or newer and glibc 2.28 or newer are needed.
  • The installer adds missing prerequisites (curl, tar, libcap), creates an unprivileged user and installs the hardened systemd services toutwaf-dp (ports 80 and 443) and toutwaf-cp (console, port 9443).
  • If ufw is active it opens 80 and 443 and the console port 9443 (restrict it to your admin network with --console-from). Port 9444 is never opened automatically.
  • SELinux is not used by default on Debian and Ubuntu and no AppArmor profile is shipped: the systemd sandbox is the confinement.

The commands, step by step

Instale los requisitos previos (apt)

bash
sudo apt update && sudo apt -y upgrade
sudo apt -y install curl tar ca-certificates ufw

Instale con el instalador de una línea

El script descarga los binarios nativos para su arquitectura, crea un usuario dedicado sin privilegios e instala los servicios systemd reforzados toutwaf-dp (plano de datos, puertos 80 y 443) y toutwaf-cp (plano de control y consola, puerto 9443), y después muestra sus datos de primer acceso.

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash

¿Prefieres leer primero el script?

Descárguelo, revíselo y luego ejecútelo. Recomendado para servidores de producción.

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
less install.sh
sudo bash install.sh

Opciones del instalador

Una instalación nueva vive en una sola carpeta, /var/toutwaf (bin, conf, data y logs; cámbiela con --home DIR o TOUTWAF_HOME), y las herramientas de línea de comandos se enlazan en /usr/local/bin. Una instalación anterior conserva sus propias rutas (/etc/toutwaf, /var/lib/toutwaf) y nunca se mueve.

options
# only let your admin network reach the console (port 9443)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --console-from 203.0.113.0/24

# do not touch the host firewall / choose the installation home
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --no-firewall
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --home /opt/toutwaf

# name the channel explicitly (the installer of the dev branch already takes the dev channel; no stable version exists yet)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --channel dev

Abra el cortafuegos (ufw)

El instalador abre estos puertos por defecto cuando firewalld o ufw está activo: 80 y 443, y el puerto 9443 de la consola (restrínjalo a su red de administración con --console-from). El puerto 9444 de los agentes nunca se abre al público. Estos comandos solo hacen falta con --no-firewall, con otro cortafuegos o para hacerlo a mano.

ufw
sudo ufw allow 80,443/tcp
sudo ufw allow from 203.0.113.0/24 to any port 9443 proto tcp
sudo ufw --force enable
sudo ufw status

Gestione los servicios

Ambos servicios arrancan con el sistema. Use estos comandos para iniciarlos, detenerlos o reiniciarlos.

systemd
sudo systemctl enable --now toutwaf-cp toutwaf-dp
sudo systemctl restart toutwaf-cp toutwaf-dp
sudo systemctl stop toutwaf-dp toutwaf-cp

Compruebe los servicios

bash
sudo systemctl status toutwaf-cp toutwaf-dp --no-pager
toutwafctl doctor
curl -kI https://127.0.0.1:9443/
curl -s http://127.0.0.1:9101/healthz
sudo journalctl -u toutwaf-dp -u toutwaf-cp -n 50 --no-pager

Actualizar

Haga una copia de la configuración y de los datos y vuelva a ejecutar el instalador: conserva sus ajustes y revierte por sí solo si la nueva versión no queda sana. Las rutas mostradas son las de una instalación nueva (/var/toutwaf); una instalación anterior conserva /etc/toutwaf y /var/lib/toutwaf. También puede actualizar desde la consola, en la página Actualizaciones.

bash
sudo mkdir -p /var/toutwaf.bak
sudo cp -a /var/toutwaf/conf /var/toutwaf/data /var/toutwaf.bak/
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --update --yes
curl -s http://127.0.0.1:9101/healthz

Desinstalar

El primer bloque elimina los servicios, los binarios y las reglas de cortafuegos añadidas por ToutWAF, y conserva sus datos. El segundo elimina además la configuración, los datos y los registros.

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
sudo bash install.sh --uninstall
purge
sudo bash install.sh --uninstall --purge

What is not verified

We prefer to say it plainly.

  • “Tested” means the full installation passed in a container with systemd on that version; it has not been tried on a clean real machine.
  • No stable version exists yet: the public version is the development version 0.3.0-dev.

Other ways to install

Learn more in the documentation