You can run server-side GTM on any VPS: Google publishes the same Docker image it uses on Cloud Run (gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable). You run it twice, once as the tagging server and once as the single preview server, put both behind HTTPS on your own subdomains, and keep the image updated. The server itself is light: in our load test one container used about 150 MB of memory and handled over 1,000 requests a second on one CPU. What self-hosting really costs is the work around it: certificates, updates, restarts, monitoring and logs. Choose it if you already run servers; choose managed hosting if you want tracking without that job.
TagLinc is managed server-side GTM hosting, so we are not neutral. But we run Google's image ourselves, in Docker on our own servers, so the numbers below are from our own setup, not from a vendor's marketing page.
What "self-hosting" means
Server-side GTM is not something you install from Google Tag Manager's website; it is a program you run. Google ships it as one Docker image with two roles:
| Role | What it does | How many | Settings it needs |
|---|---|---|---|
| Tagging server | Receives your site's requests and runs the clients and tags | One or more (Google recommends a cluster for availability) | CONTAINER_CONFIG, PREVIEW_SERVER_URL |
| Preview server | Powers Tag Manager's Preview mode | Exactly one (Google: do not autoscale it) | CONTAINER_CONFIG, RUN_AS_PREVIEW_SERVER=true |
CONTAINER_CONFIG is the string Tag Manager shows when you create the server container (Admin → Container settings). The same value goes on every instance.
A minimal VPS setup
- Two subdomains pointed at the VPS, for example
data.yourstore.com(tagging) andpreview.yourstore.com(preview). Using your own domain is what makes server-set cookies work. - Run the preview server: the image with
RUN_AS_PREVIEW_SERVER=trueand yourCONTAINER_CONFIG. - Run the tagging server: the same image with your
CONTAINER_CONFIGandPREVIEW_SERVER_URL=https://preview.yourstore.com. - Put a reverse proxy in front (Caddy, Traefik or nginx) for HTTPS certificates. Google's requirement: the proxy's timeout must be longer than 20 seconds, or Preview mode breaks.
- Health check: the image answers on
/healthy; restart a container that does not. - Tell Tag Manager the tagging server URL (Admin → Container settings → Server container URLs), then point your web container's Google tag at it with
server_container_url.
Each server should get at most one CPU: Google says extra CPUs are not used, because the program runs on one core. To handle more traffic you add instances, not cores.
What our own load test showed
On 12 November 2026 we load-tested one of our own Server GTM containers: Google's image, limited to 1 CPU and 2 GB, on a 2 vCPU / 4 GB server, receiving GA4 /g/collect requests over HTTPS.
| Measurement | Result |
|---|---|
| Steady 30-second run, 50 at a time | about 1,160 requests a second, 0 failed |
| Response time in that run | 37 ms median, 108 ms at the 99th percentile |
| CPU | the container sat at its 1-CPU limit |
| Memory, tagging server | about 60 MB idle, about 150 MB under load |
| Memory, preview server | about 25 MB |
Read this carefully: the test container had no published tags, so nothing was forwarded to Google or Meta. Real tags make each request heavier, which is why Google's own guidance is far lower: it expects 2 to 10 servers to handle 35 to 350 requests a second, depending on your tags. Either way, a typical store sending 1 to 5 million requests a month averages under 2 requests a second. Raw capacity is rarely the problem.
Where the real cost is
Google's own example on Cloud Run costs about $45 a month per server (1 vCPU, 0.5 GB, CPU always allocated), and it recommends at least two servers, so roughly $90 a month before traffic. A small VPS can run the same image for less. The bigger cost on both is the work:
- Certificates and domains for two subdomains, renewed automatically and monitored.
- Image updates. Google updates the image for security fixes and new features and recommends updating at least on each major version, and restarting periodically. Every instance and the preview server need the same version.
- Uptime. One server is a single point of failure: when it is down, events are lost, not queued. Google recommends a cluster for this reason.
- Monitoring and logs. Without request logs you cannot tell whether a drop in conversions is your ads or your server.
- Scaling for peaks such as sale days, and your own time when something breaks on a weekend.
Self-hosting vs Cloud Run vs managed hosting
| Your own VPS | Google Cloud Run | Managed host (e.g. TagLinc) | |
|---|---|---|---|
| Monthly cost | The VPS, plus your time | About $45 per server, 2 recommended, plus traffic | A flat plan (TagLinc: free up to 15,000 requests, then $15 to $75) |
| Setup | Docker, proxy, certificates, two subdomains | Google's setup flow, then domain mapping | Create a container, add a domain |
| Updates and restarts | You | You (redeploy) | The host |
| Request logs | You build them | Cloud Logging, billed by volume | Included |
| Control | Full | High | Lower: the host decides the setup |
For Cloud Run in more detail, see TagLinc vs Google Cloud. To compare prices at your own volume, use the Server GTM cost calculator.
When self-hosting makes sense
- You already run servers with monitoring, and one more Docker service is little extra work.
- You need full control: a specific country for data, your own logging pipeline, custom networking.
- You run many containers for clients (an agency) and want one setup for all of them.
When managed hosting is the better deal
- Nobody on the team wants to be on call for tracking.
- One store, a few million requests a month: the plan costs less than an hour of an engineer's time.
- You want request logs, a custom loader path and cookie extension without building them.
If you self-host: a checklist
- Tagging server on your own subdomain, HTTPS, proxy timeout over 20 seconds.
- Exactly one preview server, on its own HTTPS URL, set as
PREVIEW_SERVER_URL. - At most 1 CPU per instance; at least two tagging instances if a lost hour of data matters.
- Health check on
/healthywith automatic restart. - A routine for image updates and restarts, applied to every instance.
- Request logging and an alert when requests drop to zero.
We check your setup for free and send you what to fix.
FAQ
The software is free; the server, the domains and your time are not. Google does not charge for the image itself.
Less than most people think: in our test one container used about 150 MB of memory under load and one CPU. Plan by availability (two instances) rather than raw power.
No. You need to run Docker containers (or Node.js processes) and a reverse proxy, which shared web hosting does not allow.
Some control over the setup. You keep your own GTM containers, tags and data: moving between hosts is a matter of pointing your subdomain elsewhere.