<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rishat</title>
    <description>The latest articles on DEV Community by Rishat (@tashirka1).</description>
    <link>https://dev.to/tashirka1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4076005%2Fd81da3d9-a59a-4238-b0b4-0c00034248c1.jpg</url>
      <title>DEV Community: Rishat</title>
      <link>https://dev.to/tashirka1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tashirka1"/>
    <language>en</language>
    <item>
      <title>K2: a lightweight server monitor that ships as one static binary</title>
      <dc:creator>Rishat</dc:creator>
      <pubDate>Wed, 19 Aug 2026 18:27:43 +0000</pubDate>
      <link>https://dev.to/tashirka1/k2-a-lightweight-server-monitor-that-ships-as-one-static-binary-3fhd</link>
      <guid>https://dev.to/tashirka1/k2-a-lightweight-server-monitor-that-ships-as-one-static-binary-3fhd</guid>
      <description>&lt;p&gt;I have been tinkering with a server monitoring tool called &lt;a href="https://github.com/tashirka1/k2" rel="noopener noreferrer"&gt;K2&lt;/a&gt; and wanted to share it here. It tracks system metrics, processes, and Docker containers in real time, and the whole thing is a single static Go binary with zero runtime dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why another monitoring tool?
&lt;/h2&gt;

&lt;p&gt;Most setups I saw were either heavy (agents, databases, a bunch of moving parts) or locked to a specific vendor. K2 takes the opposite route: install one binary, point a browser at it, done. It is built to run on minimal hardware and to keep working without internet access.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;System metrics: CPU, memory, disk, network&lt;/li&gt;
&lt;li&gt;Per-process metrics, clickable from the PID in the table&lt;/li&gt;
&lt;li&gt;Container metrics via the Docker API, clickable from the container name&lt;/li&gt;
&lt;li&gt;History charts per entity with period selection (1h, 6h, 24h, 7d, 1mo)&lt;/li&gt;
&lt;li&gt;Data retention with automatic purge (default 7 days)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it is built
&lt;/h2&gt;

&lt;p&gt;The stack is deliberately boring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go + Echo on the backend&lt;/li&gt;
&lt;li&gt;htmx + templ + PicoCSS on the frontend, with Chart.js for the graphs&lt;/li&gt;
&lt;li&gt;SQLite (pure Go driver, no CGO) for storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no Node.js anywhere in the toolchain. The static assets and the database migrations are embedded into the binary with &lt;code&gt;go:embed&lt;/code&gt;, and the database file itself is created and migrated on first start. So a deployment is literally one file.&lt;/p&gt;

&lt;p&gt;The UI is a set of HTML fragments swapped in via htmx, so there is no SPA build step and no heavy JS bundle. The page updates in place and stays responsive on cheap hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;One line for a bare-metal box with systemd:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/tashirka1/k2/main/scripts/install.sh | &lt;span class="nb"&gt;sudo &lt;/span&gt;bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script downloads the latest release, installs it to &lt;code&gt;/usr/local/bin/k2&lt;/code&gt;, generates admin credentials, and sets up the service.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; the prebuilt binary is available only for &lt;strong&gt;linux-amd64&lt;/strong&gt;. On other platforms the installer aborts with a warning, so build from source or use Docker instead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Or with Docker Compose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp &lt;/span&gt;env-example .env
make up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Security basics
&lt;/h2&gt;

&lt;p&gt;The admin panel has a login form backed by signed session cookies. It locks the account for a minute after three failed attempts, which keeps a basic brute-force attack at bay on an exposed port.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it matters for me
&lt;/h2&gt;

&lt;p&gt;The binary is fully static (built with CGO disabled), which means it runs on minimal machines without pulling in anything else. That plus the &lt;code&gt;curl | sudo bash&lt;/code&gt; installer makes it close to a set-and-forget tool for a hobby server or a small homelab.&lt;/p&gt;

&lt;p&gt;The project is open source (MIT) and the repo has screenshots of the dashboards. If you run a small server and want a monitoring page that does not cost anything to run, give it a look. Feedback is welcome, either here or in the issues.&lt;/p&gt;

&lt;p&gt;Project link: &lt;a href="https://github.com/tashirka1/k2" rel="noopener noreferrer"&gt;https://github.com/tashirka1/k2&lt;/a&gt;&lt;/p&gt;

</description>
      <category>monitoring</category>
      <category>go</category>
      <category>htmx</category>
      <category>sqlite3</category>
    </item>
  </channel>
</rss>
