Skip to content

d1ceward-on-dokku/minio_on_dokku

Minio Dokku Maintenance

Run Minio on Dokku

Overview

This guide explains how to deploy Minio, an object storage server compatible with Amazon S3, on a Dokku host. Dokku is a lightweight PaaS that simplifies deploying and managing applications using Docker.

Prerequisites

Before proceeding, ensure you have the following:

Setup Instructions

1. Create the App

Log into your Dokku host and create the minio app:

dokku apps:create minio

2. Configure Authentication

Minio requires a root username and password for authentication. Set these environment variables:

dokku config:set minio MINIO_ROOT_USER=<username>
dokku config:set minio MINIO_ROOT_PASSWORD=<password>

3. Configure Persistent Storage

To persist uploaded data between restarts, create a folder on the host machine and mount it to the app container:

dokku storage:ensure-directory minio --chown false
dokku storage:mount minio /var/lib/dokku/data/storage/minio:/data

4. Configure the Domain and Ports

Set the domain for your app to enable routing:

dokku domains:set minio minio.example.com

Map the internal port 9000 to the external port 80:

dokku ports:set grafana http:80:9000

5. Increase Upload Size Limit (Optional)

To allow larger file uploads, adjust the CLIENT_MAX_BODY_SIZE environment variable. For example, to set a 10MB limit:

dokku config:set minio CLIENT_MAX_BODY_SIZE=10M

6. Deploy the App

You can deploy the app to your Dokku server using one of the following methods:

Option 1: Deploy Using dokku git:sync

If your repository is hosted on a remote Git server with an HTTPS URL, you can deploy the app directly to your Dokku server using dokku git:sync. This method also triggers a build process automatically. Run the following command:

dokku git:sync --build minio https://github.com/d1ceward-on-dokku/minio_on_dokku.git

Option 2: Clone the Repository and Push Manually

If you prefer to work with the repository locally, you can clone it to your machine and push it to your Dokku server manually:

  1. Clone the repository:

    # Via SSH
    git clone [email protected]:d1ceward-on-dokku/minio_on_dokku.git
    
    # Via HTTPS
    git clone https://github.com/d1ceward-on-dokku/minio_on_dokku.git
  2. Add your Dokku server as a Git remote:

    git remote add dokku [email protected]:minio
  3. Push the app to your Dokku server:

    git push dokku master

Choose the method that best suits your workflow.

7. Enable SSL (Optional)

Secure your app with an SSL certificate from Let's Encrypt:

  1. Add the HTTPS port:

    dokku ports:add grafana https:443:9000
  2. Install the Let's Encrypt plugin:

    dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
  3. Set the contact email for Let's Encrypt:

    dokku letsencrypt:set minio email [email protected]
  4. Enable Let's Encrypt for the app:

    dokku letsencrypt:enable minio

8. Configure the Web Console (Optional)

To access the Minio web console, configure the necessary proxy settings:

# If SSL is enabled
dokku ports:add minio https:<desired_port>:9001

# If SSL is disabled
dokku ports:add minio http:<desired_port>:9001

Replace <desired_port> with your preferred port number (default is 9001).

To fix share links generated by the console pointing to the Docker container IP instead of your domain, set the following environment variables:

dokku config:set minio \
  MINIO_SERVER_URL=https://minio.example.com \
  MINIO_BROWSER_REDIRECT_URL=https://minio.example.com:9001

Wrapping Up

Congratulations! Your Minio instance is now up and running. You can access it at https://minio.example.com.

Happy file management!

About

Dockerfile to run Minio (S3 compatible storage) on Dokku (mini-Heroku)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •