Overview of Deploying MinIO on Server¶
Prerequisites and Basic Requirements
The deployment process begins by ensuring the target server is reachable. The system waits for a successful connection before proceeding with any installation tasks. The server must have network access to download the Docker installation script from the official source. Additionally, the installation requires root privileges to install system packages and manage Docker containers. The process automatically installs the latest version of Python3 pip and specific Python libraries required to manage Docker containers, including a temporary fix for compatibility issues with the Docker Python collection.
File and Directory Structure
The application utilizes a specific directory structure for data persistence. The primary data volume is mounted at /mnt/data on the host machine. This directory is mapped directly to the /data path inside the MinIO container. This configuration ensures that all objects stored in MinIO are physically saved on the host's /mnt/data directory, allowing data to persist even if the container is removed or restarted.
Access Rights and Security
The deployment script executes with elevated privileges to install Docker and manage system services. Within the container, the configuration includes a task to set MinIO Access and Secret Keys. The script attempts to write these keys to a configuration file inside the container at /root/.minio/config.json. It is important to note that the default values provided in the deployment script are placeholders labeled YOUR_ACCESS_KEY and YOUR_SECRET_KEY. These must be changed to secure credentials before the service is used in a production environment. The container runs with the command to start the server on the data directory and expose the console interface.
Databases
MinIO is an object storage server and does not rely on a traditional relational database for its core operations. The data is stored directly in the file system within the mounted volume. No separate database installation or configuration is performed as part of this deployment.
Docker Containers and Their Deployment
The core of the application is a single Docker container named minio. The container is pulled from the quay.io/minio/minio image. It is configured to run the server command targeting the /data directory and sets the console address to port 9001. The container exposes two ports to the host: port 9000 for the MinIO API and port 9001 for the MinIO Console web interface. The deployment uses the docker_container module to ensure the container is created and running with the specified parameters. After the container starts, the system waits for port 9000 to become available on localhost to confirm the service is ready.
Proxy Servers
The provided deployment configuration does not include any proxy servers such as Nginx or Traefik. There are no tasks for configuring custom domains, SSL certificates, or Certbot. The MinIO service is exposed directly on the host's network interfaces via ports 9000 and 9001. Users must configure any external proxy or reverse proxy separately if they require domain-based access or SSL termination.
Permission Settings
The installation script ensures that the Docker installation script has executable permissions before running it. The Docker daemon is started with default permissions, and the container is run with the necessary capabilities to bind to the specified ports. The data directory /mnt/data must exist on the host and have appropriate permissions for the Docker daemon to write to it. The script does not explicitly modify file permissions on the host data directory beyond what is required for the volume mount to function.
Starting, Stopping, and Updating
Once deployed, the MinIO service runs as a Docker container. To start the service, the container is launched automatically by the deployment process. To stop the service, a user can use standard Docker commands to stop the container named minio. To restart the service, the container can be restarted using Docker commands. Updating the application involves pulling the latest version of the quay.io/minio/minio image and recreating the container. The deployment script includes a check to ensure the container is running and verifies connectivity to port 9000 before considering the deployment complete. The script also includes tasks to remove a specific lock file at /root/.jenkins_task and sends notification messages to external services upon completion of the deployment stages.