<?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: adrien</title>
    <description>The latest articles on DEV Community by adrien (@adrienmttn).</description>
    <link>https://dev.to/adrienmttn</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%2F4217007%2F2a954a4d-7bea-4aae-bf3e-78c6983975a0.png</url>
      <title>DEV Community: adrien</title>
      <link>https://dev.to/adrienmttn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adrienmttn"/>
    <language>en</language>
    <item>
      <title>I built TgCloud: An open-source image hosting &amp; CDN powered by Telegram storage (written in Go)</title>
      <dc:creator>adrien</dc:creator>
      <pubDate>Fri, 30 Oct 2026 10:45:35 +0000</pubDate>
      <link>https://dev.to/adrienmttn/i-built-tgcloud-an-open-source-image-hosting-cdn-powered-by-telegram-storage-written-in-go-ei9</link>
      <guid>https://dev.to/adrienmttn/i-built-tgcloud-an-open-source-image-hosting-cdn-powered-by-telegram-storage-written-in-go-ei9</guid>
      <description>&lt;p&gt;Hi everyone! 👋&lt;/p&gt;

&lt;p&gt;I'm a beginner developer, and over the last few weeks, I’ve been learning &lt;strong&gt;Go&lt;/strong&gt; by building side projects. Like many of you, I love creating apps, but I absolutely hate getting AWS S3 bills or dealing with rate-limited public APIs just for basic image storage.&lt;/p&gt;

&lt;p&gt;That led me to a simple, slightly crazy question:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Can Telegram be used as a reliable, zero-cost image hosting backend?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To find out, I built &lt;strong&gt;TgCloud&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Ideal for Small Projects (Not for Production!)
&lt;/h2&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Let's be clear from the start:&lt;/strong&gt; This project is absolutely not intended to be used in production environments or for large commercial projects. &lt;/p&gt;

&lt;p&gt;However, it is the perfect, lightweight, and free tool for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Hosting images for your personal &lt;strong&gt;developer portfolio&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;  Powering your &lt;strong&gt;small side-projects&lt;/strong&gt; or MVPs without putting down a credit card.&lt;/li&gt;
&lt;li&gt;  Storing your own desktop screenshots or mockups on a budget.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  What is TgCloud?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;TgCloud&lt;/strong&gt; is a self-hosted, lightweight image hosting service and CDN wrapper written in Go. It allows you to upload images via an API, a remote URL, or a clean drag-and-drop web UI.&lt;/p&gt;

&lt;p&gt;The magic part? &lt;strong&gt;It requires absolutely no database&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Quick Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://adrienmttn.github.io/TgCloud/" rel="noopener noreferrer"&gt;adrienmttn.github.io/TgCloud/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/AdrienMttn/TgCloud" rel="noopener noreferrer"&gt;AdrienMttn/TgCloud&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;em&gt;(If you like the idea, a ⭐️ on GitHub would mean the world to a beginner like me!)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;The architecture is designed to be as stateless and lightweight as possible:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Upload:&lt;/strong&gt; You POST your image (file or remote URL) to the TgCloud binary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stream &amp;amp; Store:&lt;/strong&gt; TgCloud securely streams it to your private Telegram channel using the native Telegram Bot API. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The ID:&lt;/strong&gt; Telegram stores the file on its unlimited infrastructure and returns a unique, permanent &lt;code&gt;File ID&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proxy &amp;amp; Serve:&lt;/strong&gt; When someone requests &lt;code&gt;https://your-vps.com/img/{id}&lt;/code&gt;, TgCloud fetches the raw data from Telegram's CDN and proxies it directly back to the user.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This makes it &lt;strong&gt;100% hotlink-friendly&lt;/strong&gt; and compatible with Discord, Slack, Markdown, or standard HTML &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tags!&lt;/p&gt;


&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dual Upload:&lt;/strong&gt; Supports local file upload (&lt;code&gt;multipart/form-data&lt;/code&gt;) or remote URL cloning (&lt;code&gt;application/json&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant Hotlinks:&lt;/strong&gt; Generates direct, clean URLs that display images natively anywhere on the web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Format Validation:&lt;/strong&gt; Built-in protection that auto-rejects unsupported formats (supports JPEG, PNG, GIF, and WebP).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ShareX Integration:&lt;/strong&gt; Comes with a custom &lt;code&gt;.sxcu&lt;/code&gt; config so you can upload your desktop screenshots directly to your own server.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Quick Start (Deploy in 10 seconds)
&lt;/h2&gt;

&lt;p&gt;TgCloud is compiled into a single pre-built binary, meaning you don't even need Go installed on your VPS to run it.&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="c"&gt;# 1. Clone the repo&lt;/span&gt;
git clone https://github.com.git
&lt;span class="nb"&gt;cd &lt;/span&gt;TgCloud

&lt;span class="c"&gt;# 2. Create your environment file&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"BOT_TOKEN=your_telegram_bot_token"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .env
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"CHAT_ID=your_channel_id"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; .env
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"PORT=8100"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; .env

&lt;span class="c"&gt;# 3. Run it!&lt;/span&gt;
go mod tidy &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; go run main.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your public image hosting server is now live at &lt;code&gt;http://localhost:8100&lt;/code&gt;!&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚠ Limitations to Keep in Mind
&lt;/h2&gt;

&lt;p&gt;Since this project leverages a chat platform API, it is intended for &lt;strong&gt;personal, hobby, and educational use&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rate Limits:&lt;/strong&gt; Telegram limits Bot API traffic to roughly ~30 requests per minute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File Size:&lt;/strong&gt; Maximum of 20MB per image (enforced by the Telegram Bot API).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bandwidth:&lt;/strong&gt; Since the tool proxies the image data, it uses your VPS bandwidth to serve the files, not Telegram's.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Looking for Feedback!
&lt;/h2&gt;

&lt;p&gt;As I mentioned, I am still learning Go, so I would love to hear your thoughts on the code structure, error handling, or performance improvements. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any tips on optimizing Go reverse proxies for heavy image streaming?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the code on &lt;strong&gt;&lt;a href="https://github.com/AdrienMttn/TgCloud" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/strong&gt; and let me know what you think in the comments below! 🦀&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Made with ❤ by &lt;a href="https://github.com/AdrienMttn" rel="noopener noreferrer"&gt;AdrienMttn&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>go</category>
      <category>opensource</category>
      <category>selfhosted</category>
    </item>
  </channel>
</rss>
