← sources

I built an open-source image hosting service that uses Telegram as storage

source: reddit (reddit:selfhosted)published 2026-10-26 15:41ingested 2026-10-27 02:37

retained text

Hi everyone,

I'm a beginner developer and I've been learning Go by building side projects.  
  
Over the last few weeks, I built **TgCloud**, an open-source image hosting service that uses **Telegram as its storage backend**.

The idea is simple:

>Can Telegram be used as an image hosting backend instead of S3, local storage, or a traditional database?

TgCloud is an open-source image hosting service written in Go that stores uploaded images inside a Telegram channel through the Bot API and uses Telegram file IDs to retrieve them later.  
  
**Why I built it ?**

Most image hosting solutions fall into one of these categories:

* Paid cloud storage (S3, Cloudflare R2, Backblaze, etc.)
* Rate-limited APIs
* Proprietary services
* Not self-hostable

I wanted something that anybody could deploy for free with only:

* A Telegram bot
* A Telegram channel
* A small Go server

**Current features :**

✅ Upload images from a file

✅ Upload images from a URL

✅ Direct image URLs

✅ Self-hosted

✅ Open source

✅ JPEG, PNG, GIF and WebP support  


# Example

Upload an image:

    curl -F "file=@image.png" https://tgcloud.alwaysdata.net/img

or with url : 

    curl -X POST -H "Content-Type: application/json" \
      -d '{"url":"https://example.com/image.png"}' \
    https://tgcloud.alwaysdata.net/img

  
Response : 

    { 
      "id": "AgACAgQAAxkD..." 
    }

  
Retrieve it later : 

    https://tgcloud.alwaysdata.net/img/AgACAgQAAxkD......

**What I'm looking for :** 

Since I'm still learning, I'd really appreciate feedback from more experienced developers.

I'd love to hear:

* What do you think of the architecture?
* What would you change?
* What are the biggest problems you see with this approach?
* Is there any feature you think is missing?

**GitHub:**

[https://github.com/AdrienMttn/TgCloud](https://github.com/AdrienMttn/TgCloud)

**Demo:**

[https://tgcloud.alwaysdata.net](https://tgcloud.alwaysdata.net)

Thanks for taking a look! Any feedback, criticism, or advice is welcome. I'm building this primarily to learn and improve as a developer. 🚀

document fetched 2026-10-27 00:30 · canonical https://reddit.com/r/selfhosted/comments/1xg0den/i_built_an_opensource_image_hosting_service_that