Introduction
In this tutorial, we’ll walk through how to install the open-source object storage server MinIO on Debian. MinIO is a self-hosted object storage solution, ideal for storing unstructured data such as photos, videos, log files, and backups on your own server. It’s designed to be simple, scalable, and high-performance.
By the end of this guide, you’ll have MinIO up and running on your Debian server, accessible over the web.
Prerequisites
- Basic knowledge of using the terminal.
- A valid domain or IP address.
- A Debian server with root access.
- At least 1 GB of RAM and 2 CPUs for optimal performance.
Step 1 - Update the system
Before installing MinIO, ensure your system is up-to-date:
sudo apt update && sudo apt upgrade -y
Step 2 - Install necessary dependencies
MinIO requires certain packages to be installed, such as wget
to download files. Run the following command:
sudo apt install wget -y
Step 3 - Download and install MinIO
Now, download the MinIO binary file using wget
and move it to /usr/local/bin
:
wget https://dl.min.io/server/minio/release/linux-amd64/minio
sudo mv minio /usr/local/bin/
sudo chmod +x /usr/local/bin/minio
Step 4 - Create a MinIO user
For security reasons, it's best to run MinIO under a dedicated user. Create one using the following command:
sudo useradd -r minio-user -s /sbin/nologin
sudo mkdir /home/minio-user
sudo chown minio-user:minio-user /home/minio-user
Step 5 - Set up directories for MinIO
MinIO needs a directory to store data. Create this directory and adjust permissions:
sudo mkdir /data
sudo chown minio-user:minio-user /data
Step 6 - Create a systemd service for MinIO
To run MinIO as a system service, create a new systemd unit file:
sudo nano /etc/systemd/system/minio.service
Add the following content:
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
[Service]
User=minio-user
Group=minio-user
EnvironmentFile=-/etc/default/minio
ExecStart=/usr/local/bin/minio server /data
Restart=always
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
Save and exit the file.
Step 7 - Configure environment variables
Create an environment file to define these:
sudo nano /etc/default/minio
Add your username and password:
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
Save and exit.
Step 8 - Start and enable the MinIO service
Now, start MinIO and enable it to run at boot:
sudo systemctl daemon-reload
sudo systemctl start minio
sudo systemctl enable minio
Step 9 - Access MinIO web interface
MinIO will be running on port 9000
by default. Open your web browser and navigate to:
http://your_server_ip:9000
Log in using the access and secret keys you set earlier.
When you create buckets and add objects, you can see the data on your server in /data
.
Step 10 - Secure MinIO with HTTPS (Optional)
For production environments, it's recommended to enable HTTPS. To secure MinIO, you’ll need an SSL certificate.
-
Obtain an SSL certificate using Let’s Encrypt or any other provider.
-
Move the certificate and key files to
/home/minio-user/.minio/certs/
. -
Restart the MinIO service:
sudo systemctl restart minio
Now, you can access MinIO over HTTPS.
Conclusion
You’ve successfully installed and configured MinIO on Debian! You now have a powerful object storage server ready to use. For advanced configurations, including distributed setups, visit the official MinIO documentation.