Clever Cloud
Deploy your Nuxt Application to Clever Cloud infrastructure.
Nuxt supports deploying on Clever Cloud with minimal configuration.
Deploy Clever Cloud from the Console
To deploy your Nuxt project to Clever Cloud, you will need to create a new application. The application wizard will walk you through the necessary configuration steps.
- From the lateral menubar, click Create > An application
- Choose how to deploy: Create an application from a local repository or Create an application from a GitHub repository
- Select a Node.js application, or a static one.
- Set up the minimal size for your instance and scalability options. Nuxt app must be deployed with a minimum size of XS instance for Node.js application and nano instance for static one. The build process, however, will need to be configured later with at least an M instance size to ensure it can handle the resource requirements. Depending on your project’s specifications and dependencies, you may need to adjust further as you monitor the metrics from the Overview page.
- Select a region to deploy your instance.
- Skip connecting Add-ons to your Clever application unless you’re using a database.
- Inject environment variables:
- For Node.js
CC_POST_BUILD_HOOK="npm run build"
CC_RUN_COMMAND="node .output/server/index.mjs"
CC_POST_BUILD_HOOK="yarn build"
CC_RUN_COMMAND="node .output/server/index.mjs"
CC_POST_BUILD_HOOK="pnpm build"
CC_RUN_COMMAND="node .output/server/index.mjs"
CC_POST_BUILD_HOOK="bun build"
CC_RUN_COMMAND="node .output/server/index.mjs"
- For a static application
If
ssr: false is set in nuxt.config.tsor if your project contains dynamic routes that cannot be pre-rendered, you should :- Use a Static Apache application
- Create a
.htaccessfile that redirects all routes toindex.htmlto ensure proper routing for your SPA.
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK=npm install
CC_POST_BUILD_HOOK=npm run generate
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK=yarn install
CC_POST_BUILD_HOOK=yarn generate
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK=pnpm install
CC_POST_BUILD_HOOK=pnpm generate
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK=bun install
CC_POST_BUILD_HOOK=bun generate
- Navigate to the application Information menu and enable the enable dedicated build instance option on a minimal instance of type M.
- Deploy! If you’re deploying from GitHub, your deployment should start automatically. If you’re using Git, show this docs.