NewProfiles are here!View user profiles guide
Discourse
RubyOpen Source Favorite

ImgLink for Discourse

The ImgLink Discourse plugin integrates with Discourse's upload pipeline using stdlib Net::HTTP for multipart form uploads — zero external gems required. It wraps the upload in an after_initialize guard for safety in both Discourse runtime and local development, uses the X-API-Key auth scheme, and returns CDN-delivered direct URLs that embed cleanly in Discourse posts. Works with any self-hosted Discourse 3.x installation.

Platform
Discourse 3.x
Runtime
Ruby 3.0+
Dependencies
Zero
CI Status
Passing

Requirements

  • Ruby 3.0 or higher
  • Self-hosted Discourse 3.x
  • Net::HTTP (Ruby stdlib — no gems needed)
  • ImgLink API key (free)
Used by

SaaS communities, developer forums, open source projects

Download ZIP

What's included

Zero external gem dependencies
Net::HTTP multipart boundary upload
after_initialize guard for Discourse & standalone safety
Configurable timeout and retry count
X-API-Key scoped authentication
Structured error handling with HTTP status codes
Environment variable config (IMGLINK_API_KEY)
Ruby 3.2 tested in CI

Installation Guide

Follow these steps to integrate ImgLink with Discourse.

01

Copy plugin.rb to Discourse plugins/

Extract the ZIP and copy plugin.rb into your Discourse plugins directory.

mkdir -p /var/discourse/plugins/imglink
cp plugin.rb /var/discourse/plugins/imglink/plugin.rb
02

Set environment variables

Add your ImgLink credentials to your Discourse app.yml or server environment.

IMGLINK_API_KEY=your_key_here
IMGLINK_API_BASE=https://imglink.cc
03

Rebuild Discourse

Run the standard Discourse rebuild to install the plugin.

cd /var/discourse && ./launcher rebuild app
04

Verify uploads

Create a test post, attach an image, and confirm the URL points to the imglink.cc CDN.

Why host images on ImgLink?

Global CDN

Images served from a global edge network. Sub-100ms load times. No bandwidth cost to your forum server.

Scoped API Keys

One API key per forum. Revoke or rotate instantly. Keys never leave your config file — never hardcoded.

Retry Safety

Exponential backoff on every upload. Images never fail silently — retries handle transient network issues.

Ready to deploy ImgLink on Discourse?

Download the plugin, add your API key, and go live in under 10 minutes. Free to use — no credit card required.