Deployment Overview of Incus on Server¶
Prerequisites and Basic Requirements¶
The following requirements must be met on the target server before or during the deployment process:
-
Operating System: Debian-based distribution (verified via
/etc/os-release). -
Privileges: Root access is required for installation and configuration.
-
Network: IPv4 forwarding must be enabled (
net.ipv4.ip_forward). -
Ports:
-
Internal:
8443(Incus API and Web UI). -
External:
443(HTTPS traffic via Nginx proxy).
FQDN of the Final Panel¶
The application is accessible via the following Fully Qualified Domain Name (FQDN) format:
-
incus<Server ID>.hostkey.in -
The service is served over HTTPS on port
443. -
The full URL format is:
https://incus<Server ID>.hostkey.in/
File and Directory Structure¶
The deployment utilizes the following directory structure for configuration, data, and certificates:
-
/etc/apt/keyrings/: Stores the Zabbly repository GPG key (zabbly.asc). -
/etc/apt/sources.list.d/: Contains the Zabbly Incus stable repository configuration (zabbly-incus-stable.sources). -
/root/: -
incus-preseed.yml: Pre-seed configuration file for Incus initialization. -
nginx/: Directory containing the Docker Compose configuration for the proxy. -
/var/lib/incus/: Default storage location for Incus instances and images. -
/opt/incus/ui/: Location of the Incus Web UI assets (provided byincus-ui-canonical). -
/data/nginx/: -
user_conf.d/: Contains custom Nginx configuration files for the specific domain. -
nginx-certbot.env: Environment variables for the Nginx-Certbot container. -
nginx_secrets: Volume mount point for Let's Encrypt certificates.
Application Installation Process¶
The Incus application is installed using the APT package manager from the Zabbly repository. The process includes the following steps:
-
Repository Setup:
-
The Zabbly GPG key is added to
/etc/apt/keyrings/zabbly.asc. -
The stable repository is configured in
/etc/apt/sources.list.d/zabbly-incus-stable.sources.
-
-
Package Installation:
-
The following packages are installed:
-
incus: Core container and virtual machine management. -
qemu-system: Required for running virtual machines. -
incus-ui-canonical: Provides the web-based user interface.
-
-
Initialization:
-
Incus is initialized non-interactively using the pre-seed file located at
/root/incus-preseed.yml. -
The initialization creates a default network bridge (
incusbr0) and a default storage pool (default).
-
Access Rights and Security¶
Security and access control are configured as follows:
-
User Groups:
-
The
incus-admingroup is created. -
The
rootuser is added to theincus-admingroup to manage Incus. -
Network Security:
-
IPv4 forwarding is enabled at the kernel level.
-
The Incus API and UI are bound to
127.0.0.1:8443initially, then exposed to all interfaces on port8443for internal proxying. -
Firewall:
-
External access is restricted to port
443(HTTPS) via the Nginx proxy. -
Direct access to port
8443is not exposed to the public internet.
Databases¶
-
No external database services are configured or required for the Incus application itself.
-
Incus stores its internal state and configuration in its local storage pool located at
/var/lib/incus.
Docker Containers and Their Deployment¶
A Docker container is deployed to handle reverse proxying and SSL certificate management.
-
Container Image:
jonasal/nginx-certbot:latest -
Deployment Method: Docker Compose
-
Compose File Location:
/root/nginx/compose.yml -
Configuration Details:
-
Restart Policy:
unless-stopped -
Network Mode:
host -
Volumes:
-
nginx_secrets(external) mounted to/etc/letsencryptfor certificate storage. -
/data/nginx/user_conf.dmounted to/etc/nginx/user_conf.dfor custom configurations.
-
-
Environment:
-
CERTBOT_EMAIL: Set to[email protected]. -
Additional environment variables are loaded from
/data/nginx/nginx-certbot.env.
-
Proxy Servers¶
Nginx is utilized as a reverse proxy to handle SSL termination and route traffic to the Incus Web UI.
-
Proxy Configuration:
-
The Nginx container listens on port
443(HTTPS). -
Traffic is proxied to the Incus service running on
https://127.0.0.1:8443. -
SSL/TLS:
-
Managed automatically by the
nginx-certbotcontainer. -
Certificates are stored in the
nginx_secretsvolume. -
Custom Domain:
-
The proxy is configured for the domain
incus<Server ID>.hostkey.in. -
The configuration file is located at
/data/nginx/user_conf.d/incus<Server ID>.hostkey.in.conf. -
The
proxy_passdirective is set tohttps://127.0.0.1:8443.
Permission Settings¶
File and directory permissions are set as follows:
-
/etc/apt/keyrings/: Mode0755. -
/etc/apt/sources.list.d/zabbly-incus-stable.sources: Mode0644. -
/root/incus-preseed.yml: Mode0600, owned byroot:root. -
/root/nginx/: Mode0755, owned byroot:root. -
/root/nginx/compose.yml: Mode0644, owned byroot:root. -
/data/nginx/user_conf.d/: Mode0755(inferred from standard Nginx config practices and volume mount).
Location of Configuration Files and Data¶
Key configuration files and data locations include:
-
Incus Pre-seed:
/root/incus-preseed.yml -
Incus Storage:
/var/lib/incus/storage-pools/default -
Incus UI Assets:
/opt/incus/ui/ -
Nginx Compose:
/root/nginx/compose.yml -
Nginx Custom Config:
/data/nginx/user_conf.d/incus<Server ID>.hostkey.in.conf -
Nginx Environment:
/data/nginx/nginx-certbot.env
Available Ports for Connection¶
The following ports are utilized by the deployed services:
-
Port 443: HTTPS (External access via Nginx proxy).
-
Port 8443: HTTPS (Internal access to Incus API and Web UI).
Starting, Stopping, and Updating¶
Service management is handled via systemd for Incus and docker compose for the proxy.
Incus Service Management:
-
Start/Enable:
Note: Ifincus.socketis not present, the fallback service isincus.service. -
Check Status:
Nginx Proxy Management:
-
Start/Restart:
-
Stop:
Updating:
-
To update Incus packages:
-
To update the Nginx container image: