<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>shadowe1ite - tcm</title>
    <subtitle>Welcome to my website — this is the place where I share all my work, experiments, notes, and random things I’m building or breaking along the way.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://batman.part-of.my.id/tags/tcm/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://batman.part-of.my.id"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-09-03T23:14:00+05:30</updated>
    <id>https://batman.part-of.my.id/tags/tcm/atom.xml</id>
    <entry xml:lang="en">
        <title>Running Ollama on Google Colab with Tailscale</title>
        <published>2026-09-03T00:00:00+00:00</published>
        <updated>2026-09-03T23:14:00+05:30</updated>
        <author>
          <name>shadowe1ite</name>
        </author>
        <link rel="alternate" type="text/html" href="https://batman.part-of.my.id/blog/running-ollama-on-google-colab-with-tailscale/"/>
        <id>https://batman.part-of.my.id/blog/running-ollama-on-google-colab-with-tailscale/</id>
        <content type="html" xml:base="https://batman.part-of.my.id/blog/running-ollama-on-google-colab-with-tailscale/">&lt;h1 id=&quot;running-ollama-on-google-colab&quot;&gt;Running Ollama on Google Colab&lt;&#x2F;h1&gt;
&lt;p&gt;I wanted to try the TCM Security AI Hacking 101 Lab, but my local machine wasn’t powerful enough to run a 7B parameter model comfortably. Instead of upgrading my hardware or paying for a GPU server, I decided to use Google Colab to handle the model.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;hacker.is-a.dev&#x2F;f&#x2F;zogn3bn&quot; alt=&quot;bob-i-may-not-have-a-brain-gentlemen.gif&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The idea is to run Ollama inside a Colab GPU runtime and connect to it remotely using Tailscale. This lets me use the model from my own machine while the actual inference runs on the Colab GPU.&lt;&#x2F;p&gt;
&lt;p&gt;The setup looks like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;mermaid&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;flowchart LR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    A[Local Machine] --&amp;gt;|Tailscale| B[Google Colab]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    B --&amp;gt; C[Ollama]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    C --&amp;gt; D[LLM]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    B --&amp;gt; E[GPU]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    D --&amp;gt; E&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;deploying-to-google-colab&quot;&gt;Deploying to Google Colab&lt;&#x2F;h2&gt;
&lt;p&gt;The easiest way to get started is to open the notebook directly in Google Colab.&lt;&#x2F;p&gt;
&lt;div class=&quot;buttons&quot;&gt;
  &lt;a class=&quot;suggested external&quot; href=&quot;https:&#x2F;&#x2F;colab.research.google.com&#x2F;github&#x2F;shadowe1ite&#x2F;ollama-colab-runner&#x2F;blob&#x2F;main&#x2F;ollama_colab_runner.ipynb&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open in Google Colab&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;Before running the notebook, there is one thing you need to configure: a Tailscale authentication key.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;creating-a-tailscale-authentication-key&quot;&gt;Creating a Tailscale Authentication Key&lt;&#x2F;h3&gt;
&lt;p&gt;The notebook uses Tailscale to connect the Colab runtime to your tailnet. To do that, create an auth key from the Tailscale admin console.&lt;&#x2F;p&gt;
&lt;p&gt;Go to &lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;console.tailscale.com&#x2F;admin&#x2F;settings&#x2F;keys&quot;&gt;&lt;strong&gt;Tailscale → Settings → Keys&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt; and create a new authentication key.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;batman.part-of.my.id&#x2F;blog&#x2F;running-ollama-on-google-colab-with-tailscale&#x2F;20260904-091242.webp&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;You don’t need to put the key directly inside the notebook. In fact, you shouldn’t. We’ll store it in Colab’s Secrets instead.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;adding-the-key-to-colab&quot;&gt;Adding the Key to Colab&lt;&#x2F;h3&gt;
&lt;p&gt;After opening the notebook, open the &lt;strong&gt;Secrets&lt;&#x2F;strong&gt; panel in Google Colab and add a new secret:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;batman.part-of.my.id&#x2F;blog&#x2F;running-ollama-on-google-colab-with-tailscale&#x2F;20260904-091351.webp&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Name: TAILSCALE_AUTHKEY&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Value: &amp;lt;your Tailscale auth key&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;running-the-instances&quot;&gt;Running the Instances&lt;&#x2F;h2&gt;
&lt;p&gt;Once the Colab notebook is deployed, the next step is to connect to a GPU runtime.&lt;&#x2F;p&gt;
&lt;p&gt;In Colab, click &lt;strong&gt;Runtime → Change runtime type&lt;&#x2F;strong&gt; and select a GPU. The exact GPU you get depends on what is available for your account at the time.&lt;&#x2F;p&gt;
&lt;p&gt;After connecting to the runtime, run the notebook cells from top to bottom. The notebook will install Ollama, configure the GPU, connect the instance to Tailscale, and start the Ollama server.&lt;&#x2F;p&gt;
&lt;p&gt;Once everything is running, the notebook will show the Tailscale IP address of the Colab instance. This is the address you can use from your local machine to access Ollama.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;batman.part-of.my.id&#x2F;blog&#x2F;running-ollama-on-google-colab-with-tailscale&#x2F;20260904-091850.webp&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;example:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;http:&#x2F;&#x2F;100.x.x.x:11434&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;batman.part-of.my.id&#x2F;blog&#x2F;running-ollama-on-google-colab-with-tailscale&#x2F;20260904-092221.webp&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-important&quot;&gt;
&lt;p&gt;&lt;strong&gt;Stop the Colab session when you’re done.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Google Colab’s free GPU usage is limited. Leaving the runtime running when you’re not using it can waste your available usage.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;When you’re finished, go to &lt;strong&gt;Runtime → Disconnect and delete runtime&lt;&#x2F;strong&gt; to release the GPU.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h2 id=&quot;connecting-with-tcm-security-ai-hacking-101-lab&quot;&gt;Connecting With TCM Security AI Hacking 101 Lab&lt;&#x2F;h2&gt;
&lt;p&gt;Now that Ollama is running on Colab and connected through Tailscale, we can use it with the TCM Security AI Hacking 101 Lab.&lt;&#x2F;p&gt;
&lt;p&gt;Open the lab and select the &lt;strong&gt;Cloud&lt;&#x2F;strong&gt; hardware option. For the connection method, select &lt;strong&gt;Tailscale&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Next, enter the Tailscale IP address shown in the Colab notebook. Ollama uses port &lt;code&gt;11434&lt;&#x2F;code&gt;, so the address should look like:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;http:&#x2F;&#x2F;100.x.x.x:11434&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After that, select the same model that you downloaded and started in the Colab instance.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;batman.part-of.my.id&#x2F;blog&#x2F;running-ollama-on-google-colab-with-tailscale&#x2F;20260904-092607.webp&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Once everything is configured, start the lab and open the chatbot. If the connection is working correctly, the lab will send the requests through Tailscale to the Ollama instance running on Google Colab.&lt;&#x2F;p&gt;
&lt;p&gt;This means the TCM lab is running on my local machine, while the actual LLM inference is being handled by the Colab GPU.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;batman.part-of.my.id&#x2F;blog&#x2F;running-ollama-on-google-colab-with-tailscale&#x2F;20260904-092640.webp&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;tecepeipe&#x2F;ollama-colab-runner&quot;&gt;Ollama Colab Runner&lt;&#x2F;a&gt; — The Colab notebook used to run Ollama with GPU support.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tailscale.com&#x2F;docs&quot;&gt;Tailscale Documentation&lt;&#x2F;a&gt; — Official documentation for Tailscale.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tailscale.com&#x2F;docs&#x2F;reference&#x2F;tailscale-cli&quot;&gt;Tailscale CLI Reference&lt;&#x2F;a&gt; — Documentation for commands such as &lt;code&gt;tailscale up&lt;&#x2F;code&gt; and &lt;code&gt;tailscale ip&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tailscale.com&#x2F;docs&#x2F;concepts&#x2F;tailscale-identity&quot;&gt;Tailscale Identity&lt;&#x2F;a&gt; — Explains how Tailscale identifies devices and nodes.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tailscale.com&#x2F;docs&#x2F;kb&#x2F;1245&#x2F;set-up-servers&quot;&gt;Setting up a Server on Tailscale&lt;&#x2F;a&gt; — Guide for connecting servers to a tailnet using authentication keys.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
    </entry>
</feed>
