The public Folder

Static Files

Files in public/ are served from the site root, exactly as they are.

FileURL
public/logo.svg/logo.svg
public/banners/diwali.webp/banners/diwali.webp
public/robots.txt/robots.txt (or generate it with app/robots.ts)

Example

curl -I http://localhost:3000/logo.svg

Example output

HTTP/1.1 200 OK
Content-Type: image/svg+xml
Cache-Control: public, max-age=0

Things to Know

  • Do not name a file in public/ the same as a route (public/products vs app/products).
  • Files added after next build are not served by next start in all setups. Treat public/ as build-time content; put user uploads in cloud storage (S3, Cloudinary, GCS).