The built-in app templates are a list of ready-made apps. If you want your own list, Portainer will load it from a URL.
You can set the location in Settings under App Templates, with a URL to a JSON file. Or you pass it on startup:
docker run -d ... portainer/portainer-ce:lts \
--templates http://my-host.my-domain/templates.json
The file lists template definitions in Portainer’s own format. The docs say hosting the file on GitHub avoids authentication problems, which is the simplest place to keep it.
The caveat is the flag. Templates are only loaded on first startup, so on an existing instance the flag alone changes nothing. The docs say to clear the default templates in the UI or API first. The Settings field is easier for an instance that already exists.
For your own stacks that you deploy again and again, custom templates are a separate feature and a better fit than editing JSON.
Keep the JSON file small and test it by opening the URL in a browser first. If the file does not load, Portainer has nothing to show, and the error is not always obvious.
Further reading: CLI configuration, General settings, On this site: in a Portainer stack, env_file stack.env is not the same as a .env file, On this site: migrating a stack in Portainer does not move its volumes