{"id":17422,"date":"2026-03-09T16:12:46","date_gmt":"2026-03-09T10:42:46","guid":{"rendered":"https:\/\/www.skynats.com\/blog\/?p=17422"},"modified":"2026-03-09T16:12:49","modified_gmt":"2026-03-09T10:42:49","slug":"how-to-install-thanos-sidecar-in-ubuntu","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-install-thanos-sidecar-in-ubuntu\/","title":{"rendered":"How to Install Thanos sidecar in Ubuntu"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li>Thanos is an open-source project designed to enhance the capabilities of Prometheus, especially for large-scale and long-term monitoring.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>While Prometheus is powerful for real-time metrics collection, it has limitations such as short-term storage and lack of native horizontal scalability.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Thanos solves these problems by providing long-term storage, high availability, and global query capabilities across multiple <a href=\"https:\/\/prometheus.io\/\" type=\"link\" id=\"https:\/\/prometheus.io\/\" target=\"_blank\" rel=\"noopener\">Prometheus<\/a> instances<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"> In this guide, we will walk you through the steps to Install Thanos   Sidecar on Ubuntu, enabling seamless integration with Prometheus for   scalable and reliable monitoring.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-nbsp-configure-prometheus-for-thanos\"><strong>&nbsp;Configure Prometheus for Thanos<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Edit Prometheus configuration.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/prometheus\/prometheus.yml\nAdd external labels:\nglobal:\n scrape_interval: 15s\n\n external_labels:\n   cluster: monitoring-cluster\n   replica: prometheus-1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-restart-prometheus\"><strong>Restart Prometheus<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">sudo systemctl restart prometheus<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-nbsp-enable-prometheus-tsdb-block-duration\"><strong>&nbsp;Enable Prometheus TSDB Block Duration<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Thanos requires 2h block duration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit Prometheus service file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/systemd\/system\/prometheus.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Prometheus<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Install Thanos<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Download the latest Thanos release.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/github.com\/thanos-io\/thanos\/releases\/latest\/download\/thanos-linux-amd64.tar.gz\n\ntar -xvzf thanos-linux-amd64.tar.gz\n\n--version<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-nbsp-configure-object-storage\"><strong>&nbsp;Configure Object Storage<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Thanos needs object storage (S3).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/etc\/thanos\nsudo vim \/etc\/thanos\/bucket.yml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example S3 config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>type: S3\nconfig:\n bucket: thanos\n endpoint: minio.example.com:9000\n access_key: \n secret_key: \n insecure: true<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-create-systemd-service-for-thanos\"><strong>Create Systemd Service for Thanos<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create service file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/systemd\/system\/thanos-sidecar.service<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=Thanos Sidecar\nAfter=network.target\n\n&#91;Service]\nUser=prometheus\nExecStart=\/usr\/local\/bin\/thanos sidecar \\\n  --tsdb.path=\/var\/lib\/prometheus \\\n  --prometheus.url=http:\/\/localhost:9090 \\\n  --objstore.config-file=\/etc\/thanos\/bucket.yml \\\n  --grpc-address=0.0.0.0:10901 \\\n  --http-address=0.0.0.0:10902\nRestart=always\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload systemd:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\n\nsudo systemctl enable thanos-sidecar\n\nStart service:\n\nsudo systemctl start thanos-sidecar<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Verify Thanos Sidecar<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status thanos-sidecar<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\nhttp:&#47;&#47;SERVER-IP:9091<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-conclusion\"><strong>Conclusion <\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Implementing Thanos Sidecar alongside Prometheus significantly improves the scalability and reliability of your monitoring infrastructure. While Prometheus is excellent for realtime metrics collection, it has limitations in terms of long-term storage and horizontal scalability. Thanos addresses these challenges by extending Prometheus with features like durable object storage integration, high availability, and global querying capabilities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need expert assistance to Install Thanos Sidecar on Ubuntu, the team at Skynats is here to help. Setting up Thanos with Prometheus can involve complex configurations, especially in production monitoring environments. With our <a href=\"https:\/\/www.skynats.com\/devops-support\" type=\"link\" id=\"https:\/\/www.skynats.com\/devops-support\">DevOps Support Services<\/a>, we help businesses deploy, configure, and optimize monitoring stacks to ensure scalability, reliability, and high availability. Whether you need help with installation, troubleshooting, or integrating Thanos into your existing infrastructure, our DevOps engineers can provide the right guidance and support. Contact Skynats today to simplify your deployment and keep your monitoring systems running smoothly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we will walk you through the steps to Install Thanos Sidecar on Ubuntu, enabling seamless integration with Prometheus for scalable and reliable monitoring. &nbsp;Configure Prometheus for Thanos Edit Prometheus configuration. Restart Prometheus sudo systemctl restart prometheus &nbsp;Enable Prometheus TSDB Block Duration Thanos requires 2h block duration. Edit Prometheus service file: Add: &nbsp;Prometheus [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1064,1253,1255,1252,236],"class_list":["post-17422","post","type-post","status-publish","format-standard","hentry","category-blog","tag-devops-support-services","tag-install-thanos","tag-prometheus","tag-thanos-sidecar","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/17422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=17422"}],"version-history":[{"count":1,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/17422\/revisions"}],"predecessor-version":[{"id":17423,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/17422\/revisions\/17423"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=17422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=17422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=17422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}