A template with fixed values is only half useful. Variables turn it into a small form at deploy time.
services:
db:
image: mariadb:11
environment:
MYSQL_PASSWORD: "{{ MYSQL_PASSWORD }}"
In the custom templates list, add a template and wrap values in double curly braces. Portainer then lets you set a label, a description and a default for each variable, and shows them as fields when someone deploys the template.
Variables in custom templates are a Portainer Business Edition feature. The compose file itself can come from the web editor, an upload or a Git repository.
Further reading: Portainer docs: Custom templates