MinIO is a high-performance, distributed object storage service that is compatible with Amazon S3. It is designed to store large amounts of unstructured data, such as photos, videos, backups, logs, and other forms of data. MinIO is lightweight, easy to install, and scalable, making it an excellent choice for setting up object storage on a VPS (Virtual Private Server). In this tutorial, we’ll guide you through the steps to install and configure MinIO on your VPS.
Step 1: Set Up Your VPS
-
Choose a VPS Provider
- Select a VPS with the following recommended specs:
- CPU: 1 vCPU or higher
- RAM: 2 GB or more (4 GB recommended for larger storage)
- Storage: 10 GB or more (depending on the amount of data you plan to store)
- Operating System: Ubuntu 20.04 LTS or any other compatible Linux distribution
- Select a VPS with the following recommended specs:
-
Access Your VPS via SSH
- SSH into your VPS using the terminal:
-
Update Your System
- Before installing any software, it’s important to update your system:
Step 2: Install Dependencies
MinIO requires a few dependencies, including wget
to download the binary. Ensure they are installed on your VPS:
- Install Wget and other utilities
Step 3: Install MinIO on Your VPS
-
Download MinIO
- Visit the MinIO download page to find the latest stable release. Alternatively, use the following command to download MinIO directly:
-
Make MinIO Executable
- After downloading, make the MinIO binary executable:
-
Move the MinIO Binary to /usr/local/bin
- To ensure MinIO is accessible from anywhere on your system, move it to
/usr/local/bin
:
- To ensure MinIO is accessible from anywhere on your system, move it to
Step 4: Create a Directory for MinIO Data
MinIO needs a directory where it can store object data. You can create a directory for MinIO’s data and logs:
-
Create a MinIO directory
- You can replace
/data
with any other directory where you want to store MinIO data.
- You can replace
-
Set Proper Permissions
- Ensure that MinIO has the necessary permissions to access the directories:
Step 5: Start MinIO
You can start MinIO using a simple command. To do this, you need to provide an access key and secret key for security. These keys are used to authenticate users when interacting with the MinIO server.
-
Start MinIO with the desired access and secret keys
-
Replace
accesskey
andsecretkey
with your own values. These keys will be used to access the MinIO service: -
The command specifies:
--console-address ":9001"
: The address for the MinIO web console.--address ":9000"
: The address for the MinIO API.--access-key
and--secret-key
: The access and secret keys for authentication./data
: The directory to store object data.
-
-
Access MinIO Web Console
-
Once MinIO is running, you can access the MinIO web interface (console) by visiting:
-
Log in with the access and secret keys you set earlier. You can now start creating buckets, uploading objects, and managing your storage.
-
Step 6: Configure MinIO as a Service (Optional)
To ensure MinIO starts automatically when your server boots up, you can create a systemd service.
-
Create a systemd Service File
- Create a new service file for MinIO in
/etc/systemd/system/
:
- Create a new service file for MinIO in
-
Add the following content to the file:
- Replace
YOURACCESSKEY
andYOURSECRETKEY
with your actual credentials.
- Replace
-
Enable and Start MinIO Service
-
Enable MinIO to start on boot:
-
Start the MinIO service:
-
Check the status of MinIO:
-
Step 7: Configure MinIO for Remote Access
To access MinIO from external devices or applications, you'll need to configure your firewall (if applicable) to allow inbound traffic on ports 9000 (API) and 9001 (console).
-
Allow Traffic on Ports 9000 and 9001 (UFW example)
-
Configure DNS (Optional)
- If you want to access MinIO via a domain name, you can configure a DNS A record pointing to your VPS’s IP address and set up a reverse proxy (e.g., using Nginx) to manage access via
https
.
- If you want to access MinIO via a domain name, you can configure a DNS A record pointing to your VPS’s IP address and set up a reverse proxy (e.g., using Nginx) to manage access via
Step 8: Secure MinIO with SSL (Optional)
For better security, you can enable SSL encryption for MinIO. You can do this using a reverse proxy like Nginx and a free SSL certificate from Let’s Encrypt.
-
Install Nginx and Certbot
- Install Nginx and Certbot for SSL:
-
Configure Nginx Reverse Proxy
-
Create an Nginx configuration file to reverse proxy MinIO’s traffic:
-
Add the following configuration:
-
-
Enable the Nginx Configuration
- Enable the site configuration by creating a symbolic link:
-
Obtain SSL Certificate with Certbot
-
Run Certbot to obtain an SSL certificate:
-
Follow the prompts to complete the SSL certificate setup.
-
-
Restart Nginx
- Restart Nginx to apply the changes:
Step 9: Use MinIO for Object Storage
Now that MinIO is up and running, you can begin storing and managing your objects. You can interact with MinIO via its web console, API, or CLI tools.
- Create Buckets and Upload Files
- From the MinIO web console, create buckets and upload files by following the intuitive interface.
- Integrate with S3-Compatible Applications
- MinIO’s S3 compatibility allows you to integrate it with third-party applications that support Amazon S3, such as backup solutions, media storage platforms, and data analytics tools.
Conclusion
Congratulations! You have successfully installed and configured MinIO on your VPS for object storage. MinIO’s high-performance and S3-compatible features make it an excellent choice for managing large-scale unstructured data. Whether you're storing backups, media, or logs, MinIO offers a scalable, reliable, and cost-effective solution for object storage needs. Make sure to secure your MinIO instance, especially if it's exposed to the internet, by using SSL and strong access keys.