Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Self-hostable image optimization service for Next.js — a drop-in replacement for Vercel's Image Optimization with a free cloud CDN.
Next.js Image Transformation is an open-source, self-hostable image optimization service that acts as a drop-in replacement for Vercel's Image Optimization API for Next.js applications.
Next.js Image Transformation is a deployment template for Coolify that bundles a lightweight API written in Bun and an Imgproxy instance. It takes image URLs with width, height, and quality query parameters and returns transformed images on the fly. The service is designed to replace the Vercel Image Optimization endpoint, so Next.js projects can use it with minimal configuration changes. The GitHub repository behind the template has 633 stars.
next/image components keep working after you swap the loader file.Deploy the template through Coolify, optionally setting ALLOWED_REMOTE_DOMAINS to limit which external image hosts are allowed. In your Next.js project, add a custom loader file and point it to your transformation API domain. The loader builds a request with width and quality query parameters, and the API forwards the request to Imgproxy, which returns the optimized image.
The self-hosted version is open-source, so you can run it on your own infrastructure at no cost. The cloud version at images.coollabs.io offers a free global CDN with simple pricing.
Yes, the template is designed as a drop-in replacement. You set next.config.js to use a custom loader and update the loader file to route requests to your transformation API.
Currently width, height, and quality are supported. These are passed as query parameters and processed by Imgproxy.
Yes, the documentation includes a live test URL where you can change the width, height, and quality query parameters on a sample image to see the transformations happen instantly.
