> ## Documentation Index
> Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# Deliver images with the Next.js Image component (video tutorial)

[githublink]: https://github.com/cloudinary-community/cloudinary-examples/tree/main/examples/nextjs-next-image-loader

## Overview

Learn how to deliver Cloudinary images in your Next.js application using the [Next.js Image component](https://nextjs.org/docs/api-reference/next/image). Add Cloudinary URLs to the list of allowed domains for the Image component and use the built-in Next.js Cloudinary loader to take advantage of more Cloudinary features.

> **NOTE**: The instructions to [serve images directly from Cloudinary](#serve_images_directly_from_cloudinary) work only for Next.js 12 and below due to Next.js 13 deprecating global loaders. Instead, try the [CldImage](nextjs_image_transformations) component of the [Next Cloudinary](nextjs_integration) library.

## Video tutorial

  This video is brought to you by Cloudinary's video player - embed your own!Use the controls to set the playback speed, navigate to chapters of interest and select subtitles in your preferred language.

> **TIP**: :title=View the code

You can find the code from this tutorial in [GitHub][githublink].
## Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
### The Next.js Image component
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=0 :sec=05 :player=cld} | There are many components and tools that Next.js provides out of the box, including the [Next.js Image component](https://nextjs.org/docs/api-reference/next/image), which implements its own optimization capabilities. You can use the Image component together with Cloudinary delivery URLs to take advantage of both technologies.
|

### Replace existing img tags with Next.js Image components
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=0 :sec=21 :player=cld} | Import the Image component from `next/image` and swap your existing `img` tags for `Image` components. 
|

### Add the Cloudinary domain to the allowed list
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=0 :sec=29 :player=cld} | To allow images to originate from Cloudinary, add the Cloudinary domain to the allowed list. In **next.config.js**, add an `images` property containing a `domains` property.  The `domains` property is an array of domains where you are serving your images from, for example, `res.cloudinary.com`.  See [example code](https://github.com/cloudinary-community/cloudinary-examples/tree/main/examples/nextjs-next-image-domain).
|

### Serve images directly from Cloudinary
{table:class=tutorial-bullets}|  | 
| --- | --- |
|{videotime:id=media :min=1 :sec=15 :player=cld} | **Only for Next.js 12 and below.** To allow images to be served directly from Cloudinary, use the loaders functionality. In **next.config.js**,replace the `domains` property with a `loader` key that has a value of `cloudinary`. Add a `path` key, and set the value to the first part of your delivery URLs, for example, `https://res.cloudinary.com/my_cloud/image/upload`. Then, remove that part of the address from each of the image URLs in your code. See [example code](https://github.com/cloudinary-community/cloudinary-examples/tree/main/examples/nextjs-next-image-loader) (this doesn't use global loaders so can be used with Next.js 13).
|

## Keep learning

> **READING**:
>
> * Watch more [Dev Hints videos](https://www.youtube.com/playlist?list=PL8dVGjLA2oMpaTbvoKCaRNBMQzBUIv7N8) on the [Cloudinary YouTube channel](https://www.youtube.com/cloudinary).

> * Try out the [Next Cloudinary](nextjs_integration) library that provides components to enable you to upload and apply popular Cloudinary transformation and optimization features to your media when building Next.js applications.

#### If you like this, you might also like...

  
  
  
    Embedding Videos in Next.js
    Use the Cloudinary Video Player to embed videos using Next.js 
  

  
  
  
    AI Generative Fill using Next.js
    Extend images using generative AI in a Next.js app 
  

  
  
  
    Create Social Media Cards in Next.js
    Dynamically create social media image cards using Next.js 
  

&nbsp;

&nbsp;Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
&nbsp;
