Deployment Overview of Docuseal on Server¶
Prerequisites and Basic Requirements¶
To deploy Docuseal on the server, the following requirements must be met:
-
Operating System: Linux distribution compatible with Docker and Docker Compose.
-
Privileges: Root access or a user with
sudoprivileges to manage Docker services and firewall rules. -
Domain: A valid domain name or subdomain pointing to the server's IP address.
-
Ports: TCP ports 80 and 443 must be available for external access.
FQDN of the Final Panel¶
The application is accessible via the following Fully Qualified Domain Name (FQDN) format:
docuseal<Server ID>.hostkey.in:443
Replace <Server ID> with the specific identifier assigned to the server instance. The application listens on port 443 for HTTPS traffic.
File and Directory Structure¶
The deployment utilizes the following directory structure for configuration files and data storage:
-
/opt/docuseal: Main directory containing configuration files. -
/opt/docuseal/Caddyfile: Reverse proxy configuration for Caddy. -
/opt/docuseal/compose.yml: Docker Compose definition file. -
Docker Volumes:
-
docuseal_data: Stores application data. -
postgres_data: Stores PostgreSQL database files. -
caddy_data: Stores Caddy data and certificates. -
caddy_config: Stores Caddy configuration files.
Application Installation Process¶
The application is deployed using Docker Compose. The installation process involves the following steps:
-
Create the necessary directories at
/opt/docuseal. -
Generate the
Caddyfileandcompose.ymlconfiguration files. -
Create the required Docker volumes:
docuseal_data,postgres_data,caddy_data, andcaddy_config. -
Execute the Docker Compose command to start the services.
The deployment uses the following Docker images:
-
docuseal/docuseal:latestfor the main application. -
postgres:15for the database. -
caddy:latestfor the reverse proxy and SSL termination.
Access Rights and Security¶
Firewall rules are configured to allow external traffic on specific ports:
-
Port 80 (TCP): Enabled for HTTP traffic.
-
Port 443 (TCP): Enabled for HTTPS traffic.
These rules are applied to the public zone of the firewall to ensure secure external access.
Databases¶
The application uses a PostgreSQL database with the following configuration:
-
Image:
postgres:15 -
Database Name:
docuseal -
User:
postgres -
Connection Method: Internal Docker network connection.
-
Storage Location: Data is persisted in the
postgres_dataDocker volume mounted at/var/lib/postgresql/data. -
Health Check: The database performs a health check using
pg_isready -U postgresevery 5 seconds with a timeout of 5 seconds and 5 retries.
Docker Containers and Their Deployment¶
The deployment consists of three main containers defined in the compose.yml file:
| Container Name | Image | Description |
|---|---|---|
app | docuseal/docuseal:latest | Main Docuseal application service. |
postgres | postgres:15 | PostgreSQL database service. |
caddy | caddy:latest | Reverse proxy handling SSL and routing. |
The app container depends on the postgres container being healthy before starting. All containers are configured with restart policies to ensure high availability.
Proxy Servers¶
Caddy is used as the reverse proxy server to handle incoming traffic and SSL termination:
-
Configuration File:
/opt/docuseal/Caddyfile -
Function: Routes traffic from the external domain to the internal
appservice on port 3000. -
SSL: Automatically manages SSL certificates for the configured domain.
-
Ports:
-
80 (TCP): HTTP
-
443 (TCP): HTTPS
-
443 (UDP): HTTPS (QUIC support)
The Caddy container mounts the configuration file from /opt/docuseal/Caddyfile to /etc/caddy/Caddyfile inside the container.
Permission Settings¶
File and directory permissions are set as follows:
-
/opt/docuseal: Ownerroot, Grouproot, Mode0755. -
/opt/docuseal/Caddyfile: Ownerroot, Grouproot, Mode0644. -
/opt/docuseal/compose.yml: Ownerroot, Grouproot, Mode0644.
Docker volumes are managed by the Docker daemon and do not require manual permission adjustments on the host filesystem.
Location of Configuration Files and Data¶
Configuration files and data are located in the following paths:
-
Configuration Directory:
/opt/docuseal -
Caddyfile: Proxy configuration. -
compose.yml: Service definitions. -
Data Volumes:
-
docuseal_data: Application data. -
postgres_data: Database storage. -
caddy_data: Caddy data. -
caddy_config: Caddy configuration.
Available Ports for Connection¶
The following ports are available for external and internal connections:
| Port | Protocol | Description |
|---|---|---|
| 80 | TCP | HTTP (Redirected to HTTPS by Caddy) |
| 443 | TCP | HTTPS (Secure access to Docuseal) |
| 443 | UDP | HTTPS (QUIC support) |
| 3000 | TCP | Internal application port (not exposed externally) |
| 5432 | TCP | Internal PostgreSQL port (not exposed externally) |
Starting, Stopping, and Updating¶
Service management is handled via Docker Compose commands executed from the /opt/docuseal directory:
-
Start Services:
-
Stop Services:
-
Update Services: To update the application, pull the latest images and restart the containers:
-
View Logs: