MinIO is a high-performance, distributed object storage system that's compatible with Amazon S3 APIs. It's designed to handle large amounts of unstructured data, making it a perfect solution for modern data storage needs. In this guide, we'll walk you through the process of setting up MinIO as your S3 storage.
Prerequisites π
Before you begin, ensure you have the following:
- A Linux-based server.
- Docker and Docker Compose installed.
- Basic command line knowledge.
Step 1: Install Docker and Docker Compose π
If Docker and Docker Compose are not already installed on your server, use the following script to install them:
#!/bin/bash
# Function to install Docker
install_docker() {
echo "Installing Docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker $USER
rm get-docker.sh
echo "Docker installed successfully."
}
# Function to install Docker Compose
install_docker_compose() {
echo "Installing Docker Compose..."
sudo curl -L "https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo "Docker Compose installed successfully."
}
# Check if Docker is installed
if ! [ -x "$(command -v docker)" ]; then
install_docker
else
echo "Docker is already installed."
fi
# Check if Docker Compose is installed
if ! [ -x "$(command -v docker-compose)" ]; then
install_docker_compose
else
echo "Docker Compose is already installed."
fi
echo "Please log out and log back in for Docker permissions to take effect if Docker was just installed."
Save this script as install_docker.sh
, make it executable, and run it:
chmod +x install_docker.sh
./install_docker.sh
Step 2: Create the docker-compose.yml
File π¦
The docker-compose.yml
file defines the services that Docker will manage. Here's how you can set up MinIO using Docker Compose:
version: '3.3'
services:
minio:
image: minio/minio
command: server /data
ports:
- "9000:9000"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio-data:/data
volumes:
minio-data:
Step 3: Start MinIO Container π
Start your Docker containers with the following command:
docker-compose up -d
This command runs your services in the background. Verify that your services are running:
docker ps
You should see a container running for MinIO.
Step 4: Access MinIO Dashboard π
Open your web browser and navigate to http://<your-server-ip>:9000
. You should see the MinIO login page.
Use the following default credentials to log in:
- Access Key: minioadmin
- Secret Key: minioadmin
Step 5: Create a Bucket ποΈ
Once logged in, you can create a new bucket:
- Click on the "Buckets" link.
- Click on the "Create Bucket" button.
- Enter a name for your bucket and click "Create".
Step 6: Use MinIO Client (Optional) π»
MinIO provides a command-line client (mc) that you can use to interact with your MinIO server. You can install it by following these steps:
Download the MinIO client:
wget https://dl.min.io/client/mc/release/linux-amd64/mc
Make the binary executable:
chmod +x mc
Move the binary to your PATH:
sudo mv mc /usr/local/bin/
Configure the client to connect to your MinIO server:
mc alias set myminio http://<your-server-ip>:9000 minioadmin minioadmin
You can now use the
mc
command to interact with your MinIO server. For example, to list all buckets:mc ls myminio
Congratulations, your post has been upvoted by @upex with a 0.80% upvote. We invite you to continue producing quality content and join our Discord community here. Keep up the good work! #upex
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit