Portainer App Templates can be used to easily deploy Docker containers with predefined settings. At the moment it is not possible to add more than one App Template definition URL to Portainer. Merging App Template definitions has to be done by hand.
This application allows you to add your own App Template definitions, merge them with existing ones and host them on your own server. You can set the Portainer App Templates URL from within the application to easily switch App Template definitions.
- A server with Docker installed
- Portainer v2 installed
The application does not recognize the Portainer v1 App Template definition format.
In the next section you will create the Docker container for the application. After the application is created, in your browser go to
http://SERVER_URL:<port on host> to start the application (e.g.
If you want to be able to set the App Templates URL in Portainer from within the application, you need to provide the
PORTAINER_PASSWORD environment variables.
Don’t forget to set the
PGID if you use volume host directories (
-v parameter) and don’t want permission issues. See below for details. Make sure you create the volume host directories upfront and assign the correct permissions.
Create the application
Here are some examples to help you get started creating the container for the application.
Code language: HTML, XML (xml)
--- version: '3.3' services: portainer-tools: container_name: portainer-tools environment: - PUID=<puid> - PGID=<pgid> - SERVER_URL=<application url> - PORTAINER_URL=<portainer url> - PORTAINER_USERNAME=<portainer username> - PORTAINER_PASSWORD=<portainer password> ports: - <port on host>:9999 volumes: - <path to config on host>:/config restart: unless-stopped image: technorabilia/portainer-tools
You can also use
docker run to start the application. More information here.
Don’t forget to change the necessary parameters before running the command. See below for details.
Code language: HTML, XML (xml)
docker run -d \ --name portainer-tools \ -e PUID=<puid> \ -e PGID=<pgid> \ -e SERVER_URL=<application url> \ -e PORTAINER_URL=<portainer url> \ -e PORTAINER_USERNAME=<portainer username> \ -e PORTAINER_PASSWORD=<portainer password> \ -p <port on host>:9999 \ -v <path to config on host>:/config \ --restart unless-stopped \ technorabilia/portainer-tools
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate
<external>:<internal> respectively. For example,
-p 8888:9999 would expose port
9999 from inside the container to be accessible from the host’s IP-address on port
8888 outside the container.
|Process User ID. See below for details.|
|Process Group ID. See below for details.|
|The URL your application will be accessed on (e.g. |
|The URL for Portainer (e.g. |
This will default to
|Map port |
|Store database and templates on the Docker host (e.g. |
If you use volume host directories (
-v parameter), there can be permission issues between the host and the container.
To make sure that there are no permission issues, you can specify the
PGID of the user that owns the volume directory on the host.
To find the values for
PGID, you can use the
id [USER] command as follows.
Code language: Markdown (markdown)
$ id youruser uid=1024(youruser) gid=128(youruser) groups=128(youruser)
In this example
PUID is 1024 and
PGID is 128.
Using the application
When you start the application for the first time, you will see the following on your screen (click to enlarge).
The following App Template definitions are already created at startup.
- Custom – An example App Template definition that you can use to add your own definitions. More info here.
- LinuxServer.io – An App Template definition that holds all applications provided by LinuxServer.io (daily updated!).
- Portainer – This is the default App Template definition provided by Portainer.
A possible scenario can be as follows.
- Create your own App Template definition file based on the Custom or other definitions.
- Upload your own definition file.
- Merge your own definition with other definitions (hosted on your server or elsewhere).
- Select the merged definition and set the App Template definition URL in Portainer.
Although the functionality of the application is pretty self-explanatory, below is a brief explanation of the buttons and its function.
|Merge||Merge the selected App Template definitions.|
Definitions will be merged from top to bottom.
If needed, you can change the sort order on the Name/URL column for the desired order.
A new definition will be created with the name “Merged” and filename “merged.json”.
If a definition already exists with the name “Merged” or filename “merged.json”, that definition will be reused / overwritten.
|Upload||Upload your own App Template definition file.|
This definition file will be hosted on your server.
|Add||Add a new App Template definition that is hosted elsewhere.|
|View||View the App Template definition in the browser.|
|Set||Set the App Template definition URL in Portainer.|
|Update||Update the App Template definition.|
Here you can change the name or the URL of the definition.
|Delete||Delete the App Template definition.|
If you find a problem, you can submit it on GitHub. I will then look at it as soon as possible.
The use of PUID and PGID was inspired by LinuxServer.io.