Skip to content

Dockerfile to run Dolibarr (ERP and CRM software) on Dokku (mini-Heroku)

License

Notifications You must be signed in to change notification settings

d1ceward-on-dokku/dolibarr_on_dokku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Dolibarr Dokku Maintenance

Run Dolibarr on Dokku

Overview

This guide explains how to deploy Dolibarr, a modern ERP and CRM software package, 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 dolibarr app:

dokku apps:create dolibarr

2. Configure the Database

Install, create, and link the MariaDB plugin to the app:

# Install MariaDB plugin
dokku plugin:install https://github.com/dokku/dokku-mariadb.git mariadb

# Create a MariaDB instance
dokku mariadb:create dolibarr

# Link the database to the app
dokku mariadb:link dolibarr dolibarr

3. Configure Persistent Storage

To persist uploaded data between restarts, create folders on the host machine and mount them to the app container:

# Documents directory
dokku storage:ensure-directory dolibarr-documents --chown false
dokku storage:mount dolibarr /var/lib/dokku/data/storage/dolibarr-documents:/var/www/documents

# Custom directory
dokku storage:ensure-directory dolibarr-custom --chown false
dokku storage:mount dolibarr /var/lib/dokku/data/storage/dolibarr-custom:/var/www/html/custom

4. Configure the Domain and Ports

Set the domain for your app to enable routing:

dokku domains:set dolibarr dolibarr.example.com

Map the internal port 80 to the external port 80:

dokku ports:set grafana http:80:80

5. 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 dolibarr https://github.com/d1ceward-on-dokku/dolibarr_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 git@github.com:d1ceward-on-dokku/dolibarr_on_dokku.git
    
    # Via HTTPS
    git clone https://github.com/d1ceward-on-dokku/dolibarr_on_dokku.git
  2. Add your Dokku server as a Git remote:

    git remote add dokku dokku@example.com:dolibarr
  3. Push the app to your Dokku server:

    git push dokku master

Choose the method that best suits your workflow.

6. 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 dolibarr email you@example.com
  4. Enable Let's Encrypt for the app:

    dokku letsencrypt:enable dolibarr

Wrapping Up

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

Happy managing!

About

Dockerfile to run Dolibarr (ERP and CRM software) on Dokku (mini-Heroku)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks