Deployment Overview of RustFS on Server¶
Prerequisites and Basic Requirements¶
To ensure a successful deployment, the following requirements must be met:
-
Operating System: Ubuntu.
-
Privileges: Root or sudo access is required for package installation and Docker management.
-
Network/Ports:
-
80(HTTP) for Let's Encrypt challenges and redirection. -
443(HTTPS) for secure web console and S3 API access. -
Dependencies: The system must have
curlandca-certificatesinstalled.
FQDN of the final panel on the hostkey.in domain¶
The application is accessible via a specific subdomain generated based on the server ID.
| Parameter | Value |
|---|---|
| Prefix | rustfs |
| Domain | hostkey.in |
| Full template | rustfs{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
The application uses the following directory structure for configuration and data persistence:
-
/root/rustfs: Application installation directory containing the Docker Compose file and environment variables. -
/data/rustfs: Data storage directory where S3 objects are stored (managed by user10001). -
/root/nginx: Configuration directory for the reverse proxy. -
/data/nginx: Nginx configuration files and SSL certificate management data.
Application installation process¶
The installation is performed through a multi-step process involving system preparation and container orchestration:
-
System Preparation: The system cleans up existing Docker repository sources to prevent conflicts and ensures
ca-certificatesandcurlare present. -
Docker Installation: The Docker engine is installed on the host system.
-
Application Setup:
-
A directory for RustFS is created at
/root/rustfs. -
An environment file (
.env) is generated containing theRUSTFS_ACCESS_KEYand a secure secret key. -
The application deployment configuration (Docker Compose) is prepared in
/root/rustfs/compose.yml. -
Reverse Proxy Setup:
-
Nginx directories are initialized for SSL management via Certbot.
-
A reverse proxy configuration is generated to handle HTTPS termination and routing between the web console and the S3 API.
Access Rights and Security¶
-
Firewall: If
UFW(Uncomplicated Firewall) is active, ports80/tcpand443/tcpare automatically allowed. -
Container Security: The RustFS container is configured with
no-new-privileges:trueto restrict privilege escalation. -
User Permissions: Data stored in
/data/rustfsis owned by UID10001to match the application's internal user requirements.
Databases¶
This application does not utilize a separate database server; it manages object storage directly within the configured data directory.
Docker Containers and Their Deployment¶
The deployment consists of two primary container services:
RustFS Service¶
-
Image:
docker.io/rustfs/rustfs:1.0.0 -
Container Name:
rustfs -
Ports:
-
127.0.0.1:{9000}:{9000}(S3 and Admin API) -
127.0.0.1:{9001}:{9001}(Web Console) -
Volumes:
/data/rustfsmapped to/data. -
Environment Variables:
-
RUSTFS_VOLUMES=/data -
RUSTFS_ADDRESS=0.0.0.0:9000 -
RUSTFS_CONSOLE_ENABLE=true -
RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001 -
Restart Policy:
unless-stopped
Nginx Proxy Service¶
-
Image:
jonasal/nginx-certbot:6.2.0-nginx1.31.0 -
Network Mode:
host -
Volumes:
-
nginx_secrets(external volume) mapped to/etc/letsencrypt. -
/data/nginx/user_conf.dmapped to/etc/nginx/user_conf.d. -
/data/nginx/letsencryptmapped to/var/www/letsencrypt. -
Restart Policy:
unless-stopped
Application Update Instructions¶
To update the main RustFS application, navigate to the installation directory and pull the latest images:
Location of configuration files and data¶
| Type | Path |
|---|---|
| Application Environment | /root/rustfs/.env |
| Docker Compose (App) | /root/rustfs/compose.yml |
| Nginx Configuration | /data/nginx/user_conf.d/{domain}.conf |
| Object Data Storage | /data/rustfs |
Available ports for connection¶
-
Web Console:
443(via HTTPS) -
S3 API:
443(via HTTPS)
Starting and Stopping the application¶
The application is managed via Docker Compose from the installation directory.
To start the application:
To stop the application:
Proxy Servers¶
The deployment utilizes an Nginx container with Certbot integration to provide SSL termination.
-
SSL: Certificates are managed via Let's Encrypt. The renewal interval is set to 8 days.
-
Routing Logic:
-
Requests to the root path (
/) are redirected to the web console at/rustfs/console/. -
Traffic for
/rustfs/console/is proxied to the internal Web Console port. -
All other traffic (S3 API requests) is proxied to the internal API port.