This tutorial shows how to upload tiles in GeoPackage or MBTiles to MapTiler Cloud using the command-line utility.
Getting the token
In order to successfully upload your resources using the command-line utility, you will need to acquire your own token for authentication. Navigate to the "Credentials" section of your account administration pages and click on New Credentials if you have not done so yet.
After creating the credentials you will be able to copy the token:
Using the CLI utility
You will need Python 3 environment on your machine to use this utility. We are going to start off with an empty project, but the steps will be similar if you are integrating this utility into an existing project.
We will be using standard Python tools; virtual environment and pip, alternatively you can use a different package manager like Poetry.
1. Creating a virtual environment
Let's make sure you are using the right version of python by running
python -V, the output should indicate Python 3.6 or above, in our case it's
If not, please install a more up-to-date version, follow the instructions on the Python web.
Now we are going to create our project folder and make a virtual environment inside of it:
You should be able to see the newly created folder
test_cli_venv inside the project folder.
2. Installing the maptiler-cloud-cli
We are going to source the virtual environment and install
maptiler-cloud-cli inside of it.
3. Uploading a new tileset
This code snippet assumes that your desired file is placed in the project directory however, you could use an absolute path to reference files outside the project folder.
4. Update a tileset
You can use the tileset ID to upload a new file to the same tileset.
maptiler-cloud --token=MY_TOKEN tiles ingest --document-id=EXISTING_TILESET_ID ISLANDS_v2.mbtiles
If you want to automate the uploading of your assets to MapTiler Cloud or just don't want to bother with using the browser interface, we have developed a
maptiler-cloud-cli utility to serve your needs.
For more control over tileset management, you can use the Admin API. The admin API allows you to create, update or delete a tileset, among other actions.