# Local development Use Python 3.12 or later. From the repository root, install the panel and its development tools in a virtual environment. ```sh python3 -m venv .venv . .venv/bin/activate python -m pip install -e '.[dev]' export COULOBRE_SECRET_KEY="$(python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())')" export COULOBRE_DEBUG=1 python manage.py migrate python manage.py createsuperuser python manage.py runserver ``` Open and sign in with the administrator account. Select **Add hosting account** and enter a name and a primary domain such as `example.org`. Open an account from the list to edit its details or request an Apache preview. Manage users, groups, and permissions at `/admin/`. Use **Hosting plans** to add named plans with an optional description. Choose a plan when creating or editing an account. Existing accounts start unassigned. Operators need permission to view hosting plans before they can assign one. Set a database limit and a mailbox limit on a hosting plan to cap how many requests each assigned account can make through the panel. A blank limit allows unlimited requests. Zero blocks new requests of that type. Accounts without a plan have unlimited requests. The account page shows usage for configured limits. Mailboxes count toward the same limit across all of an account's mail domains, including domains retained after a primary domain change. Changing or reassigning a plan preserves existing databases and mailboxes. If the new limit is at or below current usage, the panel blocks additional requests of that type. ## Give a reseller access to assigned accounts In `/admin/`, create a normal user and add a **Reseller** record for that user. Then open a hosting account in Coulobre Panel and select the reseller when editing the account. Existing accounts start with no reseller assigned. The reseller can sign in to Coulobre Panel to see their assigned accounts, each account's hosting plan, and its web provisioning previews. To let the reseller add accounts, set a positive account limit and select the available hosting plans in the reseller's admin record. The reseller's account list shows their allowance. The limit applies to self-service creation, and operator assignments also count toward the allowance. New reseller accounts automatically belong to that reseller and require an allowed plan. A limit of zero keeps the reseller's access read-only. Platform operators manage existing accounts, assignments, reseller allowances, and node deployment files. The local database defaults to `db.sqlite3`. Set `COULOBRE_SQLITE_PATH` to use a different file. Keep `COULOBRE_DEBUG` for local development. ## Give a customer access to hosting accounts In Coulobre Panel, open **Customers** and select **Add customer**. Enter a username and initial password. Select the customer when adding or editing a hosting account. Repeat the assignment for each hosting account the customer should be able to access. To give an existing user customer access, add a **Customer** record for that user in `/admin/`. The customer can sign in to Coulobre Panel with that username and password. Their account list shows only the hosting accounts assigned to them. Each account page shows its hosting plan, database requests, DNS zones, and mailbox requests. Customers can request databases and mailboxes for their own accounts within their plan limits. Operators deploy those requests on the hosting nodes. Use **Suspend sign-in** in the customer list to block panel access for that customer across all their hosting accounts. Use **Restore sign-in** to give them access again. Account assignments are preserved through suspension. Operators need the **Can view customer** permission to use the customer list and select a customer on hosting accounts they can create or edit. **Can add customer** enables customer creation. **Can change customer** enables sign-in suspension and restoration. ## View the panel as a customer In **Customers**, select **View as customer** next to an active customer. The panel shows the customer's assigned hosting accounts and resource pages. Request forms are visible with their inputs disabled. The banner identifies the customer and offers **End customer view**. Ending the view returns you to your administrator account. Signing out ends the view and signs you out of the panel. A support session lasts up to 30 minutes and applies to the current browser session. The panel checks that both users remain eligible on each request. For example, suspending the customer or removing the administrator's permission ends the view on the next request. A staff user needs both **Can view customer** and **Can view the panel as a customer**. The second permission is listed under **Customer impersonation sessions**. In `/admin/`, users with **Can view customer impersonation session** can review the administrator, customer, timestamps, and outcome for each session. The audit records are read-only in Django admin. ## Request a MariaDB database Open a hosting account and select **Request database**. Choose a short suffix such as `wordpress`. The panel derives the full database name from the account ID and suffix, so two accounts can each request a database named `wordpress`. The account page shows the requested databases. Operators can download a versioned deployment manifest containing the account ID and suffix. Resellers can view the requested database names on their own assigned accounts. The manifest describes the database to provision on a MariaDB node. Use the installed node command to validate the manifest and display the derived database and login names. ```sh coulobre-database-node inspect coulobre-database-1.json ``` ### Apply a database manifest Use a local MariaDB server with Unix socket authentication for `root@localhost`. Install Coulobre with the `mariadb` extra in a root-owned virtual environment and apply the downloaded manifest on that server. ```sh sudo /opt/coulobre/bin/coulobre-database-node apply coulobre-database-1.json ``` The default socket is `/run/mysqld/mysqld.sock`. Use `--socket` for a different local socket. The command creates a UTF-8 database and one login at `localhost` with privileges on that exact database. The command reports the path to a root-only credentials file under `/var/lib/coulobre/database-node/`. Use those credentials when configuring the application. Reapplying a manifest preserves the existing password and can complete an interrupted first installation. Coulobre uses its local registry and a database ownership marker to distinguish managed databases from existing resources. ### Check a database installation Run the following command on the MariaDB node with the same manifest and socket used for installation. ```sh sudo /opt/coulobre/bin/coulobre-database-node status coulobre-database-1.json ``` The read-only check verifies the local registry, the database ownership marker and the application's direct MariaDB grants. It then connects over the local socket with the stored application credentials and selects the database. The JSON report includes the database and login names, the state, and a diagnostic message when the installation needs attention. | State | Exit code | Meaning | | --- | --- | --- | | `configured` | 0 | All checks passed. | | `not_installed` | 2 | The registry, database, and login are absent. | | `needs_attention` | 2 | Provisioning or restore is incomplete, or the installation differs from the expected configuration. | Exit code `1` indicates an invalid manifest or an unavailable check, for example when the MariaDB administrative connection fails. ### Back up and restore a managed database Run these commands as root on the MariaDB node. Install the MariaDB client utilities and the Coulobre package with its `mariadb` extra. Use the same database manifest and socket as for provisioning. Add `--socket PATH` when using a custom socket. ```sh sudo install -d -m 0700 /var/backups/coulobre sudo /opt/coulobre/bin/coulobre-database-node backup-database \ coulobre-database-1.json /var/backups/coulobre/database-1.sql.gz ``` The node writes a gzip-compressed SQL dump containing the database's schema, rows, views, triggers, routines, and events. Database objects with a definer must use the managed application login. The dump uses a single transaction for InnoDB data. Pause schema changes and writes to nontransactional tables during backup. Choose a new filename for each backup and keep archives in a root-controlled directory with file permissions of `0600`. To restore, apply the original manifest on the destination node and leave the new database empty. Transfer the archive to a root-controlled directory on that node and ensure it is owned by root with permissions of `0600`. ```sh sudo /opt/coulobre/bin/coulobre-database-node restore-database \ coulobre-database-1.json /var/backups/coulobre/database-1.sql.gz ``` The node checks the gzip stream and its database identity before running the SQL. The archive needs temporary space for the uncompressed SQL on the same filesystem. Use the destination node's application credentials and keep the application disconnected until the restore completes. MariaDB can commit schema changes before reporting a restore error. If an import fails, `status` reports `needs_attention`. Inspect the partial database and return it to an empty state before retrying with the same manifest. ### Enable local database provisioning On a MariaDB node using `/run/mysqld/mysqld.sock`, install the matching Coulobre package with its `mariadb` extra in a root-owned virtual environment at `/opt/coulobre`. Enable the local provisioning socket. ```sh getent group coulobre-db-provisioning >/dev/null || sudo groupadd --system coulobre-db-provisioning sudo install -m 0644 deploy/systemd/coulobre-database-apply.socket \ deploy/systemd/coulobre-database-apply@.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now coulobre-database-apply.socket ``` Grant the socket group only to the service identity responsible for database provisioning. Send one version 1 MariaDB database manifest as UTF-8 JSON to `/run/coulobre-database-apply.sock`. The limit is 4 KiB. Close the writing half of the socket and read the JSON reply to EOF. For a valid manifest, the reply includes its identity, a state of `configured` or `failed`, and a diagnostic on failure. MariaDB passwords stay in the root-only credentials files on the node. ## Render a BIND9 zone Open a hosting account and select **Add DNS zone** to configure a zone for its primary domain. Enter the nameservers, SOA mailbox, and any A or AAAA records. To edit an existing zone, select its domain in the **DNS zones** table. - In **MX records**, enter a name, priority and mail server on each line, such as `@ 10 mx.provider.example`. Add an A or AAAA record for each mail server inside the zone. - In **TXT records**, enter a name and its value on each line, such as `_dmarc.example.net v=DMARC1; p=none`. Use a quoted JSON string to preserve leading spaces, line breaks, or an empty value. Use `@` for the zone domain in either field. Use fully qualified names for other records. The panel increments the SOA serial when the zone data changes. Changing the account's primary domain preserves its existing DNS zones. Select **Download manifest** in the DNS table and copy the file to the hosting server or a separate DNS node. Resellers can see the configured domains and serials for their assigned accounts. Operators with the appropriate permissions can add and edit zones and download manifests. The panel exports version 2 for zones containing MX or TXT records and version 1 for other zones. A manifest can also be written directly for local testing. Save the following example as `coulobre-zone.json`. ```json { "version": 1, "kind": "bind9_zone", "domain": "example.net", "serial": 1, "nameservers": ["ns1.example.net", "ns2.provider.example"], "responsible_name": "hostmaster.example.net", "addresses": [ {"name": "example.net", "address": "192.0.2.20"}, {"name": "ns1.example.net", "address": "192.0.2.53"}, {"name": "www.example.net", "address": "2001:db8::20"} ] } ``` The first nameserver is the SOA primary. Supply addresses for nameservers inside the zone. Use fully qualified names in `addresses` and DNS mailbox notation for `responsible_name`, such as `hostmaster.example.net` for `hostmaster@example.net`. Increment the SOA serial when editing a manifest by hand. Render the zone file and validate it with the `named-checkzone` utility provided by the Ubuntu `bind9-utils` package. The rendered zone is written to standard output. See the [BIND9 command reference](https://bind9.readthedocs.io/en/stable/manpages.html#named-checkzone). ```sh coulobre-dns-node render coulobre-zone.json > db.example.net named-checkzone example.net db.example.net ``` ### Include mail records in a manifest Version 2 adds the `mx_records` and `txt_records` arrays. In a version 1 manifest, update the version to `2` and add both arrays. Use an empty array when you only need one record type. Version 1 manifests still work with the updated node command. ```json { "version": 2, "mx_records": [ {"name": "example.net", "priority": 10, "exchange": "mx.provider.example"} ], "txt_records": [ {"name": "example.net", "text": "v=spf1 mx -all"}, {"name": "_dmarc.example.net", "text": "v=DMARC1; p=none"} ] } ``` Keep the domain, nameservers, mailbox and addresses from the original manifest. Increase the serial when updating a published zone. Use fully qualified record names and supply an A or AAAA record for each MX server inside the zone. Use priority `0` and exchange `.` for a null MX record at a name that receives no mail. [RFC 7505](https://www.rfc-editor.org/rfc/rfc7505.html) Supply TXT values as plain JSON strings. The renderer quotes the values and splits long UTF-8 strings into DNS character strings. DKIM readers concatenate the strings in the TXT record. [RFC 1035](https://www.rfc-editor.org/rfc/rfc1035.html) and [RFC 6376](https://www.rfc-editor.org/rfc/rfc6376.html) ### Apply a zone manifest Install `bind9` and `bind9-utils` on an Ubuntu DNS node. Use BIND9's default IN view and enable `allow-new-zones yes;` in the existing `options` block. On an authoritative-only DNS node, set `recursion no;` and configure `allow-transfer` to match your secondary servers. Set `allow-transfer { none; };` on a standalone server. Verify that the local RNDC control channel is available after applying your BIND9 configuration. ```sh sudo rndc -s 127.0.0.1 status sudo /opt/coulobre/bin/coulobre-dns-node apply coulobre-zone.json ``` Coulobre validates the zone with `named-checkzone` and installs it under `/etc/bind/coulobre/`. BIND9 persists the primary zone registration through `rndc addzone`. To publish an edit, download the updated manifest and apply it again. Coulobre checks the SOA serial, reloads the individual zone, and waits for BIND9 to report the requested serial. Reapply the same manifest to resume after an interrupted reload. See the [BIND9 command reference](https://bind9.readthedocs.io/en/v9.18.39/manpages.html#rndc) and [RFC 1982](https://www.rfc-editor.org/rfc/rfc1982.html). ### Enable local DNS publishing On a BIND9 node with the same RNDC setup, install Coulobre in a root-owned virtual environment at `/opt/coulobre`. Create the managed zone directory and enable the publishing socket. ```sh getent group coulobre-dns-provisioning >/dev/null || sudo groupadd --system coulobre-dns-provisioning sudo install -d -o root -g root -m 0755 /etc/bind/coulobre sudo install -m 0644 deploy/systemd/coulobre-dns-apply.socket \ deploy/systemd/coulobre-dns-apply@.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now coulobre-dns-apply.socket ``` Grant the socket group only to the service identity responsible for publishing zones. Send one version 1 or 2 zone manifest as UTF-8 JSON to `/run/coulobre-dns-apply.sock`, with a limit of 1 MiB. Shut down the writing half of the connection and read the JSON reply to EOF. For a valid manifest, the reply identifies the domain and SOA serial. A `configured` reply means BIND9 has loaded that serial. A `failed` reply includes a diagnostic. ## Request a virtual mailbox Open a hosting account and select **Request mailbox**. Enter the part before the `@`, such as `support`. The panel uses the account's primary domain, lowercases the local part, and converts the domain to its ASCII DNS form. Existing mailbox requests keep their addresses when the primary domain changes. The **Mailbox requests** table shows the email addresses. Operators can download a versioned manifest that contains the domain and local part. Resellers can see mailbox requests on their assigned accounts. Run the installed node command to validate the manifest and display its address. The manifest describes a virtual user for the Postfix and Dovecot mail stack. See the [Dovecot guide to Postfix and LMTP](https://doc.dovecot.org/2.3/configuration_manual/howto/postfix_dovecot_lmtp/). ```sh coulobre-mail-node inspect coulobre-mailbox-1.json ``` ### Apply a mailbox manifest Use Ubuntu 24.04 with Dovecot 2.3 or Ubuntu 26.04 with Dovecot 2.4. Install Postfix, `dovecot-imapd`, and `dovecot-lmtpd`. Install Coulobre in a root-owned virtual environment on the node. Use a Postfix hostname outside the set of hosted mail domains and keep those domains in Postfix's virtual mailbox address class. See the [Postfix virtual domain guide](https://www.postfix.org/VIRTUAL_README.html). On a fresh mail node, create the virtual mail user and empty lookup files. ```sh sudo adduser --system --group --no-create-home --home /srv/coulobre-mail \ --shell /usr/sbin/nologin coulobre-vmail sudo install -m 0644 /dev/null /etc/postfix/coulobre-domains sudo install -m 0644 /dev/null /etc/postfix/coulobre-mailboxes sudo install -o root -g dovecot -m 0640 /dev/null /etc/dovecot/coulobre-users ``` Use these values in Postfix's `main.cf`. ```ini virtual_mailbox_domains = proxy:texthash:/etc/postfix/coulobre-domains virtual_mailbox_maps = proxy:texthash:/etc/postfix/coulobre-mailboxes virtual_transport = lmtp:unix:private/dovecot-lmtp smtpd_reject_unlisted_recipient = yes ``` #### Dovecot 2.3 on Ubuntu 24.04 Replace the stock `auth-system.conf.ext` include in Dovecot's `10-auth.conf` with the following virtual user configuration. Configure Dovecot's TLS certificate and keep encrypted client authentication enabled on a public mail node. See the [Dovecot passwd-file guide](https://doc.dovecot.org/2.3/configuration_manual/authentication/passwd_file/). ```text auth_username_format = %Lu auth_cache_size = 0 passdb { driver = passwd-file args = /etc/dovecot/coulobre-users } userdb { driver = passwd-file args = /etc/dovecot/coulobre-users } ``` Set the mailbox format and enable the LMTP socket for Postfix in Dovecot. Use the output of `id -u coulobre-vmail` for both UID settings in place of the example value `103`. This limits Dovecot mailbox access to the virtual mail user on this node. See the [Dovecot UID range settings](https://doc.dovecot.org/2.3/settings/core/#first-valid-uid). ```text protocols = imap lmtp mail_location = maildir:~/Maildir first_valid_uid = 103 last_valid_uid = 103 service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { user = postfix group = postfix mode = 0600 } } ``` #### Dovecot 2.4 on Ubuntu 26.04 For a fresh, dedicated mail node, use the [Dovecot 2.4 configuration example](../deploy/dovecot/coulobre-2.4.conf.example) as `/etc/dovecot/dovecot.conf`. Set the certificate and key paths for the mail hostname. Use the output of `id -u coulobre-vmail` for both UID settings. For an existing mail node, follow the [Dovecot upgrade guide](https://doc.dovecot.org/2.4.2/installation/upgrade/2.3-to-2.4.html) to migrate its configuration and retain its Maildirs and Coulobre registry. #### Install the mailbox Start Postfix first to initialize its spool directory, then start Dovecot so it can bind the LMTP socket. Apply the manifest once both services are running. ```sh sudo /opt/coulobre/bin/coulobre-mail-node apply coulobre-mailbox-1.json ``` The command creates a private mailbox home under `/srv/coulobre-mail/`, generates the initial password, and prints the path to the root-only credentials file on the mail node. Dovecot authenticates the full mailbox address using a password hash. Postfix accepts listed recipients and hands delivery to Dovecot over the local LMTP socket. Reapply the same manifest to resume installation with the same credentials. ### Check a mailbox installation Run the status command on the mail node with the same manifest. ```sh sudo /opt/coulobre/bin/coulobre-mail-node status coulobre-mailbox-1.json ``` The check reads the local registry, mailbox home and lookup files. It queries the running Postfix service for the domain and recipient and tests the saved login against Dovecot's local authentication service. The JSON report includes the address, state and a diagnostic when the installation needs attention. | State | Exit code | Meaning | | --- | --- | --- | | `configured` | 0 | The local mailbox and service checks passed. | | `not_installed` | 2 | The mailbox is absent from the local registry and mail services. | | `needs_attention` | 2 | An installation, configuration or service check failed. | Exit code `1` indicates an invalid manifest or an invocation error such as running the check without root privileges. ### Back up and restore a mailbox Download the mailbox manifest from the panel and run the backup on the node that hosts the mailbox. Use a new archive name in a root-controlled directory. ```sh sudo install -d -m 0700 /var/backups/coulobre sudo /opt/coulobre/bin/coulobre-mail-node backup-mailbox \ coulobre-mailbox-1.json /var/backups/coulobre/mailbox-1.tar.gz ``` Coulobre uses Dovecot to copy the managed mailbox into temporary Maildir storage before creating the archive. Allow space for that copy on the mail volume. The archive contains messages, folders, IMAP flags, and subscriptions. Mailbox passwords and node configuration stay on the node. If Dovecot reports an incomplete sync, retry when the mailbox is idle. [Dovecot backup command](https://doc.dovecot.org/2.4.4/core/man/doveadm-backup.1.html) To recover mail, apply the original mailbox manifest on the destination node. Use a newly provisioned mailbox that has received no delivery or client access and has no existing `Maildir`. Keep delivery and client access paused for that mailbox until recovery completes. Keep Postfix and Dovecot running for the local configuration checks. Transfer the archive if needed and ensure it is owned by root with mode `0600`. ```sh sudo /opt/coulobre/bin/coulobre-mail-node restore-mailbox \ coulobre-mailbox-1.json /var/backups/coulobre/mailbox-1.tar.gz ``` The node checks the address and validates the archive before publishing the restored Maildir. Sign in with the destination mailbox's credentials. ### Enable local mailbox provisioning On a mail node with the same Postfix and Dovecot setup, install Coulobre in a root-owned virtual environment at `/opt/coulobre` and enable the provisioning socket. ```sh getent group coulobre-mail-provisioning >/dev/null || sudo groupadd --system coulobre-mail-provisioning sudo install -m 0644 deploy/systemd/coulobre-mail-apply.socket \ deploy/systemd/coulobre-mail-apply@.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now coulobre-mail-apply.socket ``` Grant the socket group only to the service identity responsible for mailbox provisioning. Send one version 1 mailbox manifest as UTF-8 JSON to `/run/coulobre-mail-apply.sock`, with a limit of 4 KiB. Shut down the writing half of the connection and read the JSON reply to EOF. For a valid manifest, the reply identifies the mailbox and reports `configured` or `failed`. The generated password stays in a root-only credentials file on the mail node. ## Inspect a DirectAdmin backup Use an account archive from DirectAdmin's Site Backup, Manage User Backups or Admin Backup/Transfer feature. Coulobre reads plain tar and gzip archives directly. Install the `zstd` package to read Zstandard archives. See the [DirectAdmin backup guide](https://docs.directadmin.com/directadmin/backup-restore-migration/). ```sh coulobre-directadmin inspect user.admin.customer.tar.zst ``` The command reads the archive in place and prints a JSON inventory. It reports the source account and primary domain, discovered domains, website and mail file counts, DNS zone presence, supported mailbox addresses, and database dump names. Mailboxes with names outside Coulobre's address format are counted separately. It records the presence of a nested home archive. Symbolic links, hard links and other special entries are counted separately from regular files. The inventory reads the account, domain and mailbox lists from their metadata files and checks the rest by archive entry. These metadata files have an 8 MiB limit per file. Mail and website counts refer to regular files at recognized paths. The report contains names and counts rather than passwords, hashes or file contents. ### Plan a DirectAdmin import On the panel host, use the panel's database settings to preview which account, mailbox requests and database requests can be created. ```sh python manage.py plan_directadmin_import user.admin.customer.tar.zst ``` The plan uses the source username as the account name and picks the backup's primary domain, or its only discovered domain when there is no default. Use `--primary-domain` to select a different domain from the backup. For a domainless archive, use it to assign the new account a domain. The command reads the panel database and reports `blocked` when the chosen domain is already assigned to a hosting account, DNS zone or mail domain, or when a domain still needs to be selected. The report lists database requests using the suffix after the source username and mailbox requests for the selected domain. The `manual_review` list identifies other domains, database names that need a mapping, and data that needs a separate migration, including website files, DNS zones, mail files and SQL dumps. ### Import DirectAdmin account metadata Apply the panel database migrations, then run the import on the panel host with the backup and the same primary domain selection used for the preview. ```sh python manage.py import_directadmin user.admin.customer.tar.zst ``` The import checks domain ownership again and creates the new hosting account, supported database requests and selected domain's mailbox requests in one transaction. The JSON report includes the new account ID and the MariaDB names derived from the database requests. Use the account page to download deployment manifests for the nodes. The `manual_review` list records the website, DNS, mail and SQL data that needs a separate migration. Replaying the same account and request selection reports `already_imported` for the original account. A domain conflict or a change to the original account's domain or requests can block the import. A blocked import prints its report and exits with code `2`. ### Stage DirectAdmin website files Run the following command with a path for a new directory. The command publishes the selected site's files under `document-root` inside that directory after successfully reading the backup. ```sh coulobre-directadmin stage-website user.admin.customer.tar.zst example.net ./example-net-stage ``` The default source is the domain's `public_html` directory. Use `--source-root private_html` for a separate HTTPS document root. The command writes regular files with owner-only permissions and reports the file count, size and number of skipped links or special entries. The staging directory is separate from the live web root. ### Restore a DirectAdmin website on a web node Apply the account's web deployment manifest on the web node, then run the following command with the same manifest and the original backup. ```sh sudo /opt/coulobre/bin/coulobre-web-node restore-directadmin coulobre-web-plan-1.json user.admin.customer.tar.zst ``` The command restores the manifest's domain into an empty document root. It reads and validates the entire backup before placing the files. Use `--source-root private_html` to restore that source directory instead. The report includes the file count, size and number of skipped entries. The hosting account owns the restored files. Apache can read public files through the `www-data` group. Hidden entries and entries with private source permissions stay private to the hosting account. The managed Apache configuration controls the restored site. Any restored `.htaccess` files are available for review. See the [Apache AllowOverride reference](https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride). ## Request an Apache configuration preview Start RabbitMQ and set `COULOBRE_BROKER_URL` to its AMQP URL. The development default is `amqp://guest:guest@127.0.0.1:5672//`. Use the same database and broker settings for the panel, worker, and scheduler. In separate terminals with the virtual environment active, start a worker and a scheduler. Use one worker process with SQLite. ```sh celery -A coulobre worker --pool=solo celery -A coulobre beat ``` Open an account in **Hosting accounts** and select **Request Apache preview**. The preview page shows the request status and the configuration once the worker finishes. Use **Refresh status** for pending requests or **Web provisioning** to find earlier previews. Each request captures the primary domain at queue time. The preview references the future document root and PHP-FPM socket for the account. Preview generation makes no changes to the hosting services. The panel stores requests in its database before the scheduler publishes work to RabbitMQ. After a broker outage, queued requests resume when the worker and scheduler reconnect. Plans that remain incomplete five minutes after dispatch are eligible for delivery again. ## Render configuration on a web node Open a completed preview for the account's current domain and select **Download deployment manifest**. The versioned JSON file contains the account ID and primary domain. The web node command validates those values and derives the system user, document root, and PHP-FPM socket from the account ID. Install the panel package on the node at the same revision as the panel that created the manifest. The command renders configuration to standard output. Run it as a regular user in a directory for reviewing the generated files. ```sh coulobre-web-node render coulobre-web-plan-1.json apache > apache.conf coulobre-web-node render coulobre-web-plan-1.json php-fpm > php-fpm.conf ``` The command reads the manifest and packaged templates locally. The isolated Ubuntu check below demonstrates loading the configuration. ## Apply a manifest on an Ubuntu web node Use a dedicated Ubuntu 26.04 node with Apache and PHP 8.5 FPM installed from the distribution packages. Enable FastCGI in Apache and start the native services before applying a manifest. ```sh sudo apt install apache2 php8.5-fpm sudo a2enmod proxy_fcgi sudo service php8.5-fpm start sudo service apache2 restart ``` Install the matching Coulobre package in a root-owned virtual environment on the node. Review the completed preview and transfer its deployment manifest to the node. Apply it with the node operator account. ```sh sudo /opt/coulobre/bin/coulobre-web-node apply coulobre-web-plan-1.json ``` The command reserves the account ID and domain on the node, creates a system user and a document root under `/srv/coulobre/web//public`, and installs Apache and PHP-FPM configuration. It validates both configurations, reloads PHP-FPM, waits for the per-site socket, then reloads Apache. Reapply the same manifest to retry or verify an existing installation. The node checks the account registry for domain conflicts and protects existing configuration files. If a configuration check or reload fails, the command removes the configuration it added. It reloads the prior configuration for affected services and reports any recovery errors. The account reservation and document root stay available for the next attempt. Check the local deployment state with the same manifest. ```sh sudo /opt/coulobre/bin/coulobre-web-node status coulobre-web-plan-1.json ``` The JSON report includes the manifest identity and one of three states. - `configured` means the reservation, Unix account, document root, service configuration, running services, and PHP-FPM socket match the manifest. - `not_installed` means the node has no reservation for the account. - `needs_attention` includes the first mismatch or service problem found. The status command reads local state. It exits with code 0 for `configured`, code 2 for the other report states, and code 1 if it cannot read the manifest or inspect the node. Use an HTTP request to verify the site's response as well. ### Enable HTTPS for a hosted website Apply the web deployment manifest first. Use Certbot to obtain and renew the website's Let's Encrypt certificate. The HTTP-01 challenge requires public DNS for the domain and an inbound connection on port 80. If a reverse proxy handles that port, forward `/.well-known/acme-challenge/` for the domain to the web node, preserving the host and path. [Let's Encrypt challenge types](https://letsencrypt.org/docs/challenge-types/) Prepare Apache and the shared challenge directory once per web node. Apache serves challenge files from this directory, which the web node operator controls. ```sh sudo apt install certbot sudo a2enmod ssl sudo install -d -m 0755 /var/www/coulobre-acme/.well-known/acme-challenge sudo install -m 0644 deploy/apache/acme.conf.example \ /etc/apache2/conf-available/coulobre-acme.conf sudo a2enconf coulobre-acme sudo apache2ctl configtest sudo systemctl reload apache2 ``` Use the manifest's account ID for the Certbot certificate name and its primary domain for the certificate hostname. Keep Certbot's private key root-owned with mode `0600`. Apache uses the managed Certbot lineage on port 443, with the same document root and PHP-FPM pool as the HTTP site. ```sh sudo certbot certonly --webroot --webroot-path /var/www/coulobre-acme \ --cert-name coulobre-1 --domains example.org sudo /opt/coulobre/bin/coulobre-web-node enable-https coulobre-web-plan-1.json sudo /opt/coulobre/bin/coulobre-web-node https-status coulobre-web-plan-1.json curl --fail https://example.org/ ``` `https-status` checks the local virtual host and certificate on disk. An HTTPS request verifies the certificate and response clients receive. HTTP remains available for the site and future HTTP-01 challenges. Install the renewal hook and check the Certbot timer. After a successful renewal of a Coulobre certificate, the hook validates the Apache configuration and reloads the service. ```sh sudo install -D -m 0755 deploy/certbot/reload-apache.sh \ /etc/letsencrypt/renewal-hooks/deploy/coulobre-apache systemctl status certbot.timer sudo certbot renew --dry-run --run-deploy-hooks --cert-name coulobre-1 ``` For a public domain that cannot accept inbound HTTP on port 80, Certbot can use a DNS plugin for validation. Request the certificate under the same lineage name before running `enable-https`. [Certbot certificate guide](https://eff-certbot.readthedocs.io/en/stable/using.html) To request and enable HTTPS from the panel, set up the dedicated socket and worker on the local web node. They use the same Certbot webroot, lineage name, and renewal hook. [Panel HTTPS setup](deployment.md#request-https-from-the-panel) ### Enable local web activation On a web node with the same Apache and PHP-FPM setup, systemd can accept local activation requests at `/run/coulobre-web-apply.sock`. Install the matching Coulobre package in a root-owned virtual environment at `/opt/coulobre` before enabling the socket. ```sh getent group coulobre-web-provisioning >/dev/null || sudo groupadd --system coulobre-web-provisioning sudo install -m 0644 deploy/systemd/coulobre-web-apply.socket \ deploy/systemd/coulobre-web-apply@.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now coulobre-web-apply.socket ``` Grant group membership only to the service identity responsible for provisioning sites. The socket accepts one version 1 site manifest as UTF-8 JSON, up to 4 KiB. After sending the manifest, shut down the writing half of the connection and read the JSON reply to EOF. A `configured` reply includes the account ID and domain. A `failed` reply includes a diagnostic in `problem`. Retry the same manifest if the connection closes before a reply arrives. ## Install SFTP keys on a web node Generate an Ed25519 key on the computer that will connect and choose a passphrase when prompted. With the default filename, `~/.ssh/id_ed25519.pub` is the public key file. Keep the private key on that computer. ```sh ssh-keygen -t ed25519 ``` Enable the OpenSSH configuration on the web node and apply the site's deployment manifest. Use the public key file to set the account's keys directly on that node. Running the command with an empty file removes the configured keys for new connections. [SFTP deployment setup](deployment.md#set-up-sftp-access-for-hosted-websites) ```sh sudo /opt/coulobre/bin/coulobre-web-node set-sftp-keys \ coulobre-web-plan-1.json site-access.pub sftp coulobre-1@web-node.example.org ``` ## Back up and restore hosted website files Apply the site's deployment manifest on the web node. Use that manifest to create a native website backup in a root-controlled directory. ```sh sudo install -d -m 0700 /var/backups/coulobre sudo /opt/coulobre/bin/coulobre-web-node backup-site \ coulobre-web-plan-1.json /var/backups/coulobre/site.tar.gz ``` The root-only archive contains the account and domain identity plus directories and regular files from the document root. The backup report counts symbolic links and other non-regular entries as skipped. Use a new archive filename for each backup. Pause SFTP uploads and application writes for a consistent copy. The backup detects changes while reading entries and requires site-owned files with Unix mode permissions on the document root's filesystem. To recover one file, select its path relative to the document root. Its parent directory must already exist. To overwrite an existing site-owned file at that path, add `--replace`. ```sh sudo /opt/coulobre/bin/coulobre-web-node restore-site \ coulobre-web-plan-1.json /var/backups/coulobre/site.tar.gz \ --file assets/site.css --replace ``` To restore the entire archive, run the command with an empty document root for the same account and domain. ```sh sudo /opt/coulobre/bin/coulobre-web-node restore-site \ coulobre-web-plan-1.json /var/backups/coulobre/site.tar.gz ``` Use a root-owned archive with mode `0600`. The node validates the entire archive before publishing restored files. Restored files belong to the site account, with the Apache read access recorded in the backup. The website can be recovered while its web services are stopped. ## Run an isolated PHP test site Open a completed preview for the account's current domain and select **Download test bundle**. The archive contains the exact Apache preview, a matching PHP-FPM pool, site metadata, and a small PHP test page. It is intended for the isolated Ubuntu check below. Run the test with Docker from the repository root. Set the bundle path to the downloaded tar archive. ```sh docker build -t coulobre-web-smoke tests/web-node bundle="$PWD/coulobre-web-plan-1.tar" docker run --rm --network none \ --mount "type=bind,src=$bundle,dst=/test/site.tar,readonly" \ coulobre-web-smoke ``` The Ubuntu container installs a system user for the site, checks the Apache and PHP-FPM configurations, and makes an HTTP request with the account's primary domain. A passing check confirms PHP execution through the generated socket. The container uses its own filesystem and loopback interface. ## Run the installed panel behind Apache See [Single-server deployment](deployment.md) for Gunicorn, Apache, and the systemd services for the panel, worker, and scheduler. ## MariaDB Create a dedicated MariaDB database and application user. Install the MariaDB or MySQL client headers, Python headers, a C compiler, and `pkg-config`, then add the database driver with `python -m pip install -e '.[dev,mariadb]'`. Set `COULOBRE_DB_NAME`, `COULOBRE_DB_USER`, and `COULOBRE_DB_PASSWORD` for your database and rerun `python manage.py migrate`. Set `COULOBRE_DB_HOST` and `COULOBRE_DB_PORT` if the database uses a different address from `127.0.0.1:3306`. ## Checks Install the `dev` extra and set `COULOBRE_SECRET_KEY` as described above. Use `ruff check --fix .` to apply safe lint fixes and `ruff format .` to format Python. Install the `zstd` command to exercise compressed backup fixtures. Then run the checks from the repository root. ```sh ruff check . ruff format --check . sh -n tests/web-node/smoke.sh sh -n deploy/certbot/reload-apache.sh python manage.py check python manage.py makemigrations --check --dry-run python manage.py test coulobre git diff --check ```