How to Install MinIO on VPS for Object Storage

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

  1. 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
  2. Access Your VPS via SSH

    • SSH into your VPS using the terminal:
       
      ssh username@your-vps-ip
  3. Update Your System

    • Before installing any software, it’s important to update your system:
       
      sudo apt update && sudo apt upgrade -y

Step 2: Install Dependencies

MinIO requires a few dependencies, including wget to download the binary. Ensure they are installed on your VPS:

  1. Install Wget and other utilities
     
    sudo apt install wget -y

Step 3: Install MinIO on Your VPS

  1. Download MinIO

    • Visit the MinIO download page to find the latest stable release. Alternatively, use the following command to download MinIO directly:
       
      wget https://dl.min.io/server/minio/release/linux-amd64/minio
  2. Make MinIO Executable

    • After downloading, make the MinIO binary executable:
       
      chmod +x minio
  3. Move the MinIO Binary to /usr/local/bin

    • To ensure MinIO is accessible from anywhere on your system, move it to /usr/local/bin:
       
      sudo mv minio /usr/local/bin/

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:

  1. Create a MinIO directory

     
    sudo mkdir /data sudo mkdir /var/log/minio
    • You can replace /data with any other directory where you want to store MinIO data.
  2. Set Proper Permissions

    • Ensure that MinIO has the necessary permissions to access the directories:
       
      sudo chown -R $USER:$USER /data sudo chown -R $USER:$USER /var/log/minio

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.

  1. Start MinIO with the desired access and secret keys

    • Replace accesskey and secretkey with your own values. These keys will be used to access the MinIO service:

       
      minio server /data --console-address ":9001" --address ":9000" --access-key YOURACCESSKEY --secret-key YOURSECRETKEY
    • 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.
  2. Access MinIO Web Console

    • Once MinIO is running, you can access the MinIO web interface (console) by visiting:

      arduino
       
      http://your-vps-ip:9001
    • 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.

  1. Create a systemd Service File

    • Create a new service file for MinIO in /etc/systemd/system/:
       
      sudo nano /etc/systemd/system/minio.service
  2. Add the following content to the file:

    ini
     
    [Unit] Description=MinIO After=network.target [Service] User=root ExecStart=/usr/local/bin/minio server /data --console-address ":9001" --address ":9000" --access-key YOURACCESSKEY --secret-key YOURSECRETKEY Restart=always [Install] WantedBy=multi-user.target
    • Replace YOURACCESSKEY and YOURSECRETKEY with your actual credentials.
  3. Enable and Start MinIO Service

    • Enable MinIO to start on boot:

       
      sudo systemctl enable minio
    • Start the MinIO service:

       
      sudo systemctl start minio
    • Check the status of MinIO:

       
      sudo systemctl status 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).

  1. Allow Traffic on Ports 9000 and 9001 (UFW example)

     
    sudo ufw allow 9000 sudo ufw allow 9001
  2. 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.

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.

  1. Install Nginx and Certbot

    • Install Nginx and Certbot for SSL:
       
      sudo apt install nginx certbot python3-certbot-nginx -y
  2. Configure Nginx Reverse Proxy

    • Create an Nginx configuration file to reverse proxy MinIO’s traffic:

       
      sudo nano /etc/nginx/sites-available/minio
    • Add the following configuration:

      nginx
       
      server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:9000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
  3. Enable the Nginx Configuration

    • Enable the site configuration by creating a symbolic link:
       
      sudo ln -s /etc/nginx/sites-available/minio /etc/nginx/sites-enabled/
  4. Obtain SSL Certificate with Certbot

    • Run Certbot to obtain an SSL certificate:

       
      sudo certbot --nginx -d your-domain.com
    • Follow the prompts to complete the SSL certificate setup.

  5. Restart Nginx

    • Restart Nginx to apply the changes:
       
      sudo systemctl restart nginx

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.

  1. Create Buckets and Upload Files
    • From the MinIO web console, create buckets and upload files by following the intuitive interface.
  2. 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.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution