This example shows how to deploy Mattermost on Clever Cloud using the Linux native runtime.
Mattermost is an open-source messaging platform for secure team collaboration. This example deploys Mattermost on Clever Cloud using the Linux native runtime, which runs the official Mattermost binary directly — no Docker or Node.js wrapper needed.
The mise.toml file defines two tasks:
- build: Downloads and extracts the Mattermost server binary
- run: Starts the Mattermost server
A setup-cellar.sh script is also provided to create the S3 bucket on Cellar via s3cmd.
- A Clever Cloud account
- Clever Tools CLI installed
- A running database (either a MySQL or a PostgreSQL add-on) on Clever Cloud
- A running Cellar add-on for object (S3) storage on Clever Cloud
You have two options to deploy your application on Clever Cloud: using the Web Console or using the Clever Tools CLI.
If you don't already have an account, go to the Clever Cloud console and follow the registration instructions.
- Log in to the Clever Cloud console
- Click on "Create" and select "An application"
- Choose Linux as the runtime environment
- Configure your application settings (name, region, etc.)
- Create a Cellar add-on from the console
- In the Cellar add-on dashboard, click on "Create a bucket" and give it a name
- Add the environment variable
CELLAR_ADDON_BUCKETwith the name of your bucket
In your application's settings, add the following environment variables:
| Variable | Required | Description |
|---|---|---|
MATTERMOST_VERSION |
Yes | Mattermost version to deploy (e.g., 11.5.1) |
MM_SERVICESETTINGS_LISTENADDRESS |
Yes | Must be set to :8080 |
MM_SQLSETTINGS_DRIVERNAME |
Yes | postgres or mysql |
MM_SQLSETTINGS_DATASOURCE |
Yes | Database connection string (see below) |
MM_SQLSETTINGS_MAXOPENCONNS |
Yes | Max open DB connections (see add-on dashboard > Information > Features) |
CELLAR_ADDON_BUCKET |
Yes | Name of your Cellar bucket |
MM_FILESETTINGS_DRIVERNAME |
Yes | Set to amazons3 |
MM_FILESETTINGS_AMAZONS3ACCESSKEYID |
Yes | Cellar Key ID |
MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY |
Yes | Cellar Key Secret |
MM_FILESETTINGS_AMAZONS3BUCKET |
Yes | Same as CELLAR_ADDON_BUCKET |
MM_FILESETTINGS_AMAZONS3ENDPOINT |
Yes | cellar-c2.services.clever-cloud.com |
Database connection string format:
- For PostgreSQL:
<POSTGRESQL_ADDON_URI>?sslmode=disable&connect_timeout=10 - For MySQL:
<MYSQL_ADDON_URI>?charset=utf8mb4,utf8&writeTimeout=30s
You can deploy your application using Git:
# Add Clever Cloud as a remote repository
git remote add clever git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/app_<your-app-id>.git
# Push your code to deploy
git push clever masterInstall the Clever Tools CLI following the official documentation:
# Using npm
npm install -g clever-tools
# Or using Homebrew (macOS)
brew install clever-toolsclever login# Initialize the current directory as a Clever Cloud Linux application
clever create --type linux <YOUR_APP_NAME># For PostgreSQL
clever addon create postgresql-addon <YOUR_DB_ADDON_NAME> --plan xxs_sml --link <YOUR_APP_NAME>
# Or for MySQL
clever addon create mysql-addon <YOUR_DB_ADDON_NAME> --plan s_sml --link <YOUR_APP_NAME>clever addon create cellar-addon <YOUR_CELLAR_ADDON_NAME> --plan s --link <YOUR_APP_NAME>Set the bucket name (S3 bucket names are globally unique, so using your app ID avoids conflicts):
clever env set CELLAR_ADDON_BUCKET $(clever applications -j | jq -r '.[0].app_id' | tr '_' '-')Create the bucket:
# Load env variables
eval "$(clever env -F shell)"
./setup-cellar.sh# Mattermost version (check https://mattermost.com/download/)
clever env set MATTERMOST_VERSION "11.5.1"
# Mattermost must listen on port 8080
clever env set MM_SERVICESETTINGS_LISTENADDRESS ":8080"
# Database driver
clever env set MM_SQLSETTINGS_DRIVERNAME "postgres"
# Database connection string (replace with your add-on URI)
clever env set MM_SQLSETTINGS_DATASOURCE "$(clever env | grep POSTGRESQL_ADDON_URI | cut -d= -f2 | tr -d '"')?sslmode=disable&connect_timeout=10"
# Max open DB connections (check your add-on dashboard > Information > Features)
clever env set MM_SQLSETTINGS_MAXOPENCONNS "5"
# S3 storage (uses Cellar credentials injected by the linked add-on)
clever env set MM_FILESETTINGS_DRIVERNAME "amazons3"
clever env set MM_FILESETTINGS_AMAZONS3ACCESSKEYID "$(clever env | grep CELLAR_ADDON_KEY_ID | cut -d= -f2 | tr -d '"')"
clever env set MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY "$(clever env | grep CELLAR_ADDON_KEY_SECRET | cut -d= -f2 | tr -d '"')"
clever env set MM_FILESETTINGS_AMAZONS3BUCKET "$(clever env | grep CELLAR_ADDON_BUCKET | cut -d= -f2 | tr -d '"')"
clever env set MM_FILESETTINGS_AMAZONS3ENDPOINT "cellar-c2.services.clever-cloud.com"clever deployclever openBeyond the variables listed above, Mattermost supports extensive configuration through environment variables using the MM_<SECTION>_<KEY> pattern. For example:
# Set the site URL
clever env set MM_SERVICESETTINGS_SITEURL "https://your-app.cleverapps.io"
# Enable email notifications
clever env set MM_EMAILSETTINGS_SENDEMAILNOTIFICATIONS "true"Any setting from the Mattermost configuration file can be overridden this way. See the Mattermost configuration documentation for all available options.
Once deployed, you can monitor your application through:
- Web Console: The Clever Cloud console provides logs, metrics, and other tools to help you manage your application.
- CLI: Use
clever logsto view application logs andclever statusto check the status of your application.
