Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 1.85 KB

File metadata and controls

68 lines (47 loc) · 1.85 KB
sidebar_label Deploy
description Learn how to deploy your Next.js project to Juno. Follow the deployment guide to configure static exports, set up your satellite, and publish your site to production.
keywords
Juno
Next.js
integration
quickstart
guide
build
SDK
emulator
toc_min_heading_level 2
toc_max_heading_level 2

Deploy a Next.js App

Use this guide to deploy and host your project to production.

1. Static exports

The Internet Computer, including Juno, currently does not support Server Side Rendering (without workaround). Therefore, it is recommended to generate a pre-rendered or client-side-only frontend application.

We suggest using the static exports option from Next.js.

:::note

If you’re using the official Juno Next.js plugin, static exports are already configured for you.

:::

In next.config.js file:

/** @type {import('next').NextConfig} */
const nextConfig = {
  output: "export"
};

module.exports = nextConfig;

2. Create a container

import CreateSatellite from "../components/create-satellite.mdx";

3. Configure your project

Create a juno.config.mjs file at the root of your project, and replace the PROD_SATELLITE_ID with the ID of the Satellite you created earlier.

import { defineConfig } from "@junobuild/config";

/** @type {import('@junobuild/config').JunoConfig} */
export default defineConfig({
  satellite: {
    ids: {
      development: "<DEV_SATELLITE_ID>",
      production: "<PROD_SATELLITE_ID>"
    },
    hosting: {
      source: "out",
      predeploy: ["npm run build"]
    }
  }
});

4. How to deploy

import Deploy from "../components/deploy.mdx";