
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.
Requirements
- Ruby 3.0 or higher
- Self-hosted Discourse 3.x
- Net::HTTP (Ruby stdlib — no gems needed)
- ImgLink API key (free)
SaaS communities, developer forums, open source projects
What's included
Installation Guide
Follow these steps to integrate ImgLink with Discourse.
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
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
Rebuild Discourse
Run the standard Discourse rebuild to install the plugin.
cd /var/discourse && ./launcher rebuild app
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.



