Deployment Overview of Restyaboard on Server¶
Prerequisites and Basic Requirements¶
The following requirements must be met on the target server before deploying Restyaboard:
-
Operating System: Ubuntu (compatible with
aptpackage manager). -
Privileges: Root access or
sudoprivileges are required to install Docker and manage system services. -
Domain: The deployment utilizes the
hostkey.inzone. -
Ports:
-
Internal application port:
8080(bound to127.0.0.1). -
External HTTPS port:
443(managed by the Nginx proxy). -
External HTTP port:
80(managed by the Nginx proxy for SSL redirection).
FQDN of the Final Panel¶
The application is accessible via the following Fully Qualified Domain Name (FQDN) format:
-
restyaboard<Server ID>.hostkey.in -
The service listens on port
443for secure HTTPS connections.
File and Directory Structure¶
The deployment utilizes the following directory structure for data persistence and configuration:
-
/opt/restyaboard/postgres: Persistent storage for the PostgreSQL database data. -
/opt/restyaboard/uploads: Storage directory for Restyaboard uploads. -
/root/nginx: Directory containing the Nginx proxy configuration and Docker Compose files. -
/root/nginx/compose.yml: Docker Compose configuration for the Nginx proxy service. -
/data/nginx/user_conf.d/: Directory containing custom Nginx configuration files for the specific server instance. -
/data/nginx/nginx-certbot.env: Environment file for the Nginx-Certbot service.
Application Installation Process¶
The application is deployed using Docker containers. The installation process involves the following steps:
-
Docker Installation: The system installs Docker CE, CLI,
containerd.io, and the Docker Compose plugin. -
Network Creation: A dedicated Docker network named
restya_netis created to isolate the application and database containers. -
Image Pulling: The following Docker images are pulled:
-
postgres:15 -
restyaplatform/restyaboard:v1.7.1
-
-
Database Initialization:
-
A PostgreSQL container named
restya_dbis started. -
A database role named
restyais created with a specific password. -
A database named
restyaboardis created and owned by therestyarole. -
If the database schema is empty, the SQL schema file is extracted from the application container and applied to the database.
-
-
Application Launch:
-
The Restyaboard container named
restya_appis started. -
The application connects to the
restya_dbcontainer via the internal network. -
The application listens on
127.0.0.1:8080.
-
Docker Containers and Their Deployment¶
The deployment consists of three primary Docker containers:
Restyaboard Application Container¶
-
Name:
restya_app -
Image:
restyaplatform/restyaboard:v1.7.1 -
Network:
restya_net -
Port Mapping:
127.0.0.1:8080:80 -
Restart Policy:
unless-stopped -
Environment Variables:
-
POSTGRES_HOST:restya_db -
POSTGRES_PORT:5432 -
POSTGRES_ADMIN_USER:postgres -
POSTGRES_ADMIN_PASS: (Secure password) -
RESTYA_DB_USERNAME:restya -
RESTYA_DB_USERPASS: (Secure password) -
RESTYA_DB:restyaboard
PostgreSQL Database Container¶
-
Name:
restya_db -
Image:
postgres:15 -
Network:
restya_net -
Volume Mount:
/opt/restyaboard/postgres:/var/lib/postgresql/data -
Restart Policy:
unless-stopped -
Environment Variables:
-
POSTGRES_USER:postgres -
POSTGRES_PASSWORD: (Secure password) -
POSTGRES_DB:restyaboard
Nginx Proxy Container¶
-
Service Name:
nginx(managed via Docker Compose) -
Image:
jonasal/nginx-certbot:latest -
Network Mode:
host -
Restart Policy:
unless-stopped -
Volumes:
-
nginx_secretsmounted to/etc/letsencrypt -
/data/nginx/user_conf.dmounted to/etc/nginx/user_conf.d -
Environment:
-
CERTBOT_EMAIL:[email protected]
Proxy Servers¶
The application is fronted by an Nginx proxy container that handles SSL termination and routing.
-
Proxy Software: Nginx with Certbot integration (
jonasal/nginx-certbot). -
SSL Configuration: Managed automatically by Certbot for the
hostkey.indomain. -
Routing:
-
The Nginx configuration file located at
/data/nginx/user_conf.d/restyaboard<Server ID>.hostkey.in.confcontains the location block. -
Traffic is proxied from the external port
443to the internal application addresshttp://127.0.0.1:8080. -
Configuration Management:
-
The
proxy_passdirective is set tohttp://127.0.0.1:8080;within thelocation /block. -
The Nginx service is started using
docker compose -p certproxy up -d nginxfrom the/root/nginxdirectory.
Databases¶
The application uses a PostgreSQL database for data storage.
-
Database Type: PostgreSQL version 15.
-
Connection Method: Internal Docker network communication between
restya_appandrestya_db. -
Database Name:
restyaboard. -
Database User:
restya. -
Storage Location: Data is persisted in the host directory
/opt/restyaboard/postgres. -
Schema Initialization:
-
The schema is imported from a SQL file located inside the application container (e.g.,
restyaboard_with_empty_data.sqlorpostgresql.sql). -
The schema is applied to the database if the
oauth_clientsorsettingstables are missing.
Access Rights and Security¶
-
Firewall: The application container binds only to
127.0.0.1, preventing direct external access to the application port. All external traffic must pass through the Nginx proxy on ports80and443. -
User Privileges:
-
The database uses a dedicated role
restyawith limited privileges for the application. -
The
postgressuperuser is used for administrative tasks during initialization. -
Password Security: Database passwords are managed via environment variables and are not stored in plain text within the configuration files visible in the documentation.
Permission Settings¶
The following file and directory permissions are enforced during deployment:
-
/opt/restyaboard/postgres:0755(Owner:root, Group:root). -
/opt/restyaboard/uploads:0755(Owner:root, Group:root). -
/root/nginx:0755(Owner:root, Group:root). -
/root/nginx/compose.yml:0644(Owner:root, Group:root).
Location of Configuration Files and Data¶
-
Nginx Compose File:
/root/nginx/compose.yml -
Nginx Custom Config:
/data/nginx/user_conf.d/restyaboard<Server ID>.hostkey.in.conf -
Nginx Environment File:
/data/nginx/nginx-certbot.env -
Database Data:
/opt/restyaboard/postgres -
Application Uploads:
/opt/restyaboard/uploads
Available Ports for Connection¶
-
Port 80: HTTP (Handled by Nginx proxy for SSL redirection).
-
Port 443: HTTPS (Public access to Restyaboard via Nginx proxy).
-
Port 8080: Internal application port (Bound to
127.0.0.1only, not accessible from the public internet).
Starting, Stopping, and Updating¶
The following commands are used to manage the services:
Managing the Nginx Proxy¶
- Start/Restart: (Execute from
/root/nginx)
Managing Restyaboard Containers¶
-
Start Application:
-
Stop Application:
-
Restart Application:
-
Start Database:
-
Stop Database:
-
Update Images:
(After pulling, containers must be stopped and restarted to apply updates).