Deploy the MinIO object storage service through Docker and specify the API port to be 9105. You can follow the steps below. We will explain this process in detail based on existing information.
1. Preparation
First, make sure Docker is installed on your system. If it is not installed, you can complete the installation according to the official documentation. Next, create a directory for storing MinIO data and configuration files. Here we choose/usr/local/minio
Create two subdirectories:data
Used to store actual data, andconfig
This is used to save MinIO configuration information.
mkdir -p /usr/local/minio/data mkdir -p /usr/local/minio/config
2. Pull the MinIO image
usedocker pull
Command to pull the latest MinIO image from Docker Hub:
docker pull minio/minio
This step will download the official image of MinIO to the local machine.
3. Start the MinIO container
Next, we need to run a Docker container to start the MinIO service. To meet your proposed requirement to set the API port to 9105, we will modify the default port mapping rules. At the same time, we will also assign another port (such as 9106) to the console to avoid conflicts. Here is a complete command example:
docker run \ --name minio \ -p 9105:9000 \ # Map the 9105 port of the host to the 9000 port in the container for S3 API access -p 9106:9090 \ # Map the 9106 port of the host to the 9090 port in the container for web console access -d \ --restart=always \ -e "MINIO_ROOT_USER=admin" \ # Set the administrator username -e "MINIO_ROOT_PASSWORD=admin123456" \ # Set the administrator password -v /usr/local/minio/data:/data \ # Mount the data volume -v /usr/local/minio/config:/root/.minio \ # Mount the configuration volume minio/minio server /data --console-address ":9090" --address ":9000"
In this command,-p 9105:9000
It means mapping the 9105 port of the host to the 9000 port inside the container, which is where MinIO provides S3 compatible API services;-p 9106:9090
This maps the 9106 port of the host to the 9090 port in the container for use by the MinIO Web console. In addition, we have set up an automatic restart policy (--restart=always
) so that the MinIO container will be automatically restored when the Docker service restarts.
4. Verify deployment
Once the container is successfully launched, you can access it through the browserhttp://<your-server-ip>:9106
To open MinIO's web interface, and log in with the username and password you set previously. For API requests, you can passhttp://<your-server-ip>:9105
Come and do it.
5. Things to note
- Port conflict: Make sure that the selected ports (such as 9105 and 9106) are not occupied by other applications.
- Security: Considering security factors, it is recommended to enable SSL/TLS encryption and do not use simple default credentials in production environments.
-
Persistent storage: in the above command
-v
Options are used to associate paths within the container with directories on the host to enable persistence of data. -
Environment variables: Please note that the newer MinIO version is recommended
MINIO_ROOT_USER
andMINIO_ROOT_PASSWORD
Instead of the old versionMINIO_ACCESS_KEY
andMINIO_SECRET_KEY
to define access credentials.
Through the above steps, you should be able to deploy MinIO smoothly through Docker and set its API port to 9105. If you encounter any problems or have further requirements, please refer to the official documentation or other community resources for help.
This is the article about how to deploy miniio through docker (port number 9105). For more related docker deployment miniio content, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!