Deploy Nuxt 3 on Ubuntu 22.04 with Cyberpanel

Ganes DS
4 min readMay 31, 2023

This is tutorial to deploy Nuxt 3 app on Cyberpanel including OpenLiteSpeed configuration. More or less the step is same like my other article Deploy Sveltekit.

1. Make A Website

Go to Cyberpanel, click on navigation Websites -> Create website. For a demo, just use any domain name.

After finish created, it will show on Websites ->List Websites, click on manage.

Click on preview, and remember the website base URL.

Just leave it that way, lets move to next step.

2. Nuxt 3 Local Source

In local computer, try to create new Nuxt app, mine was Nuxt 3.5.2. For reference to get started: https://nuxt.com/

After install finish, enter npm run build.

After build finish, at default it will create .output folder and lets zip all files inside that folder.

Zip all files inside .output folder

3. Upload, Extract and Install

Go to File Manager website

Browse to ‘public_html’, upload the ZIP file then extract it.

Ignore the default index.html of Cyberpanel

Back to local computer, open a command prompt, since I use Windows 10, it already include SSH.

Before go further make sure NodeJS is already installed on Ubuntu 22.04. This article can be used as reference: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-22-04.

Login to your root via SSH, then go to home directory of website just-for-test.com and enter HOST=127.0.0.1 PORT=5005 node server/index.mjs.

Keep the command prompt open.

4. LiteSpeed WebAdmin Configuration

This is for make server listen to Nuxt 3 running apps port. Lets login to OpenLiteSpeed webadmin.

Just in case, how to login to LiteSpeed panel, a reference: https://community.cyberpanel.net/t/tutorial-how-to-setup-and-login-to-openlitespeed-webadmin-console/14052

Login interface of OpenLiteSpeed WebAdmin

After login, go to Virtual Hosts

Open virtual host just-for-test.com

Click ‘External App’ tab, on far right, click ‘+’

Create External App, type Web Server, then click next.

Fill every required input, the most important is ‘Address’, the value should be the same with Nuxt app that running on Ubuntu, thats where LiteSpeed listen to Nuxt 3 app. Don’t forget to save it.

External App just created, for now ignore the warning notification.

Go to Context, click ‘Context’ tab.

This process also known as proxy, its same like Apache / Nginx proxy. Create New Context type Proxy, then click next.

Fill the required input, URI ‘/’ and choose Web Server that created before, then save it.

See the Context List, it just make new type proxy. Click icon restart to see the result.

Go to your site preview and Nuxt 3 app is running.

For make it work properly change the domain with real active domain. Perhaps this deployment process also can be used for Next JS.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Responses (1)

Write a response

Thanks a lot !