Here's what filebeat setup does (see yourself with filebeat help setup):
This command does initial setup of the environment:
* Index mapping template in Elasticsearch to ensure fields are mapped.
* Kibana dashboards (where available).
* ML jobs (where available).
* Ingest pipelines (where available).
[...]
There are a few flags you can set (again, check the help command) to e.g. set up the index template only.
You can run this command either from a host already configured or from your local machine, e.g. using a Docker image. The agent doesn't need the full configuration because you can override the configuration at runtime. Have a look at the docs on how to load the template manually.