Welcome to the Nuxt 3 Minimal Starter! This guide will help you deploy your Nuxt.js application on N0C hosting effortlessly. Follow along for a seamless deployment experience.
For more information on Nuxt 3, check out the Nuxt 3 documentation.
Demo: https://nuxt.n0c.xyz
- Node.js >= 18.0.0.
- NPM
-
Clone the Repository
Clone this repository to your local machine. Learn more
-
Install Dependencies
Install the required dependencies using NPM:
npm install
-
Configure SSH Connection
Set up an SSH connection to your N0C hosting. Learn how
-
Set Up Node.js Application on N0C
Create and configure your Node.js application on N0C hosting. Learn more
Important: During the application creation step, specify the following JavaScript entry file:
server/server.js
-
Configure Environment Variables
Copy and rename the
.env-sample
file to.env
. Enter the required variable values.USERNAME=myusername IP=XXX.XX.XXX.XXX PORT=5022 APPLICATION_NAME="ph-nuxt" DIRECTORY_PATH="/home/myusername/ph-nuxt" STARTUP_FILE="server/server.js" NODE_VERSION=20
-
Deploy Your Application
Run the deploy command:
npm run deploy
- Runs the build command
- Sets environment variables
- Restarts the application
The web server Passenger
on N0C does not support .mjs
files.
The deploy script creates a server.js
file in the server
directory that imports the index.mjs
to bypass this limitation.
It also removes the package.json
file from the server
directory.
In this demo, I explain how to manually deploy a Nuxt.js application on N0C without using the deployment script.
Enjoy deploying your Nuxt.js application with ease!