Docker 

Docker in server-side tracking: your own server instead of Google Cloud

Two people work at a desk with computers in a modern office.
Ralph Grundmann · Last updated on 20 October 2026

Docker is an open platform that lets you package applications, together with everything they need to run, into so-called containers. In server-side tracking, Docker is the way to run Google’s server container on your own server instead of leaving it to Google Cloud Run or a specialised host. Companies that care about data protection and control mainly choose this route. It can be cheaper than cloud hosting, but someone has to take care of running it.

What is Docker?

Docker packs an application with its runtime, libraries and settings into a container. The container behaves the same on every server, whether on a developer’s computer, at a German hosting provider or in the cloud. That is exactly what makes Docker interesting for running a server container: Google supplies the application ready-packed, and you only decide where it runs. Three terms are enough to understand it:

  • Image: the read-only template. For server-side tracking, Google provides a ready-made image.
  • Container: a running instance of an image. Any number of identical containers can be started from one image, for example several tagging servers.
  • Registry: a store for images. Docker Hub is the public registry; Google’s image is held in Google’s own registry.

Containers are leaner than virtual machines because they do not need their own operating system kernel but use the kernel of the server. That is why several containers fit on one small server.

Docker in server-side tracking: how it works

In server-side tracking with Google Tag Manager, the server container always runs as a container built from a Docker image. The only question is who runs it. With Google Cloud Run or a specialised host, the provider takes care of it. On your own server you set it up yourself, as described in Google’s manual setup guide:

  • Image: gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable
  • One preview server: exactly one, with CONTAINER_CONFIG and RUN_AS_PREVIEW_SERVER=true. Tag Manager’s preview mode runs through it.
  • Several tagging servers: with CONTAINER_CONFIG and the preview server’s address in PREVIEW_SERVER_URL. Google recommends running them as a cluster, with at most one virtual CPU per server.
  • Reachability: in Google’s examples the server listens on port 8080, which the PORT setting can change. Under /healthy it reports whether it is running. In front of it you need a web server or load balancer with a certificate for your domain.

Advantages of your own Docker server

  • Data protection and control: you decide where the server is located and who runs it, for example a hosting provider in Germany without a US parent company, or your own data centre. For the server itself, the question of transfers to a third country then does not arise, and you set logging, access and retention yourself. That is why companies with strict data protection requirements in particular choose this route.
  • Costs: a small cloud server at a German hosting provider costs a few euros to just over ten euros a month. Two tagging servers and one preview server therefore come to around 20 to 30 euros. For Google Cloud Run, Google quotes around 45 US dollars per server and recommends at least two, so around 90 US dollars a month.
  • Close to the website: if the container runs on the same server or behind the same proxy as the website, it is in the same network. Safari then keeps cookies set by the server for longer than the seven days to which it limits cookies from other networks.
  • Independence: no Google Cloud billing account and no billing per request as with specialised hosts.

One limitation belongs here: whatever the server forwards to GA4, Google Ads or Meta still ends up with those providers. And you need consent with your own server just as much as without it.

Disadvantages: you take over operations

  • Maintenance: Google keeps developing the image. Someone has to apply updates to the image, the operating system and the certificates; with Cloud Run or a host this happens without you.
  • Resilience and load: Cloud Run starts additional servers itself when traffic is high. On your own servers you plan reserves, load balancing and replacement in case of failure yourself. If the server fails, the data for that period is missing.
  • Monitoring: someone has to notice when the server does not respond or data does not arrive, ideally before it shows up in a report.
  • Setup details: if a proxy sits in front of the container, it has to pass on the visitors’ IP address. Otherwise the server only sees the proxy’s address, and Analytics assigns all visits to the server’s location. This does happen in practice, which is why we check it at every acceptance test.
  • Know-how: without someone who knows Linux, Docker and web servers, the server costs you save are quickly eaten up by working time.

Matomo and Piwik PRO in server-side tracking

Those who care about data protection often choose Matomo or Piwik PRO for web analytics instead of Google Analytics. Both come with their own tag manager, but it works in the browser. Matomo Tag Manager cannot do server-side tagging at present, as Matomo itself confirms. For server-side tracking, both providers therefore describe the route via a Google Tag Manager server container:

  • Matomo: Matomo can be self-hosted with the official Docker image, together with a MySQL or MariaDB database. For the server container, Matomo provides its own client template; the tracking code then points to your server address. Alternatively, your server sends the data directly to Matomo via the tracking API.
  • Piwik PRO: for the server container, Piwik PRO provides a client and a tag template; the tracking code points to your server container. Piwik PRO itself recommends combining the server container with its own tag manager. Piwik PRO also names JENTIS and, on the Enterprise plan, its own data collector on your domain, which covers analytics only.

This makes a setup entirely on your own servers possible: Matomo and Google’s server container both run as Docker containers, for example at a hosting provider in Germany. The server container then supplies advertising platforms such as Google Ads or Meta only with the data you approve.

Your own Docker server, Cloud Run or a host?

Comparison Own Docker server Google Cloud Run Specialised host
Cost per month a few euros per server, plus working time for operations around 45 US dollars per server, at least two recommended depending on requests, from around 20 US dollars
Location and provider freely selectable, including in Germany Google region selectable, provider Google depending on the host’s offer
Maintenance and updates down to you or your service provider handled by Google handled by the host
Traffic peaks plan them yourself automatic automatic within the plan
Suits you if data protection requirements are strict and IT is available you already use Google Cloud you want to start quickly

We discuss which route fits with you and your IT. The costs of the three routes in detail are on our server-side tracking page.

What else Docker is used for

Outside tracking, Docker is mainly used for development and test environments that behave like the live server, and for running applications in the cloud. Many cloud services, including Google Cloud Run, run applications as containers. The desktop application Docker Desktop is free, among others, for small businesses with fewer than 250 employees and less than 10 million US dollars in annual revenue. Companies that reach either limit, and government entities, need a subscription. Docker Engine on the server is open source.

Do you want to run server-side tracking on your own server or find out which route suits you? Then get in touch with us or read more about our server-side tracking!

 Frequently asked questions 

Docker: key questions

Is your own Docker server more privacy-friendly than Cloud Run?

It gives you more control: you decide the location, provider, logging and access, and with a host without a US connection the third-country question does not arise for the server. But whatever the server forwards to Google or Meta still ends up there, and you need consent in both cases.

Is your own Docker server cheaper?

In server costs usually yes: small servers cost a few euros a month, while Google quotes around 45 US dollars per server for Google Cloud Run. On top come maintenance, updates and monitoring. Without in-house know-how, operations can end up costing more.

Does server-side tracking also work with Matomo or Piwik PRO?

Yes. Both describe the route via a Google Tag Manager server container with their own templates, because their own tag manager works in the browser. You can also run Matomo yourself as a Docker container, so that analytics and the server container run on your own servers.

Do I need Docker for server-side tracking?

Not yourself. On Google Cloud Run or with specialised hosts, the server container also runs as a container, but the provider takes care of Docker there. You only work with Docker yourself if the server container is to run on your own server.

Is Docker free?

Docker Engine is open source. Docker Desktop is free for individuals, education, non-commercial open source projects and small businesses with fewer than 250 employees and less than 10 million US dollars in annual revenue; larger companies and government entities need a subscription.

 Request a consultation 

Questions about this topic?

Tell us briefly what it is about. You will speak directly to Ahmed Badia.
Microsoft Partner Badge
SISTRIX certified agency
4.9
Based on 33 reviews
Request a consultation
Ahmed Badia
Ahmed BadiaSenior Software Developer Team LeadCall: 0228 243 313 54

* Required

Please enter your name.

Please enter a valid email address, e.g. name@company.com.

For a call back.

Please enter your number with area code, e.g. 0228 243 313 53 or +49 228 243 313 53.

Please tell us briefly what it is about.

Free and without obligation. We usually reply within 24 hours on working days.

Information on how we process your data: Privacy policy