Skip to content
By stack3 min read

Vue.js hosting: from npm run build to a live site

Short answer

A Vue 3 app built with Vite becomes static files in a dist folder after npm run build, so it runs on any ArabyHost hosting plan. Upload the folder's contents to public_html and, if Vue Router uses createWebHistory, add an .htaccess rule that sends routes to index.html. Nuxt in SSR mode needs the AI/Developer plans.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. What you host, by project type
  2. What a Vue app needs in production
  3. Example: a Vue app in a subfolder
  4. Deploying, in short
  5. What every account includes
  6. Limits to know
  7. On ArabyHost

Vue.js runs in the visitor’s browser, so what you host is the build output, not Vue itself. A project created with npm create vue@latest uses Vite and produces a dist folder of static files you can put on any host. Most deployment problems come down to two things: Vue Router’s history mode, and the base path when the app lives in a subfolder.

What you host, by project type

Project type Build output Plan that fits
Vue 3 with Vite A dist folder of static files Any hosting plan
Vue CLI (legacy) A dist folder of static files Any plan; moving to Vite is better
Nuxt with nuxi generate A static .output/public folder Any hosting plan
Nuxt in SSR mode A Node.js server in .output/server AI/Developer plans
Vue inside Laravel via Inertia A Laravel app with Vite assets See Laravel hosting

What a Vue app needs in production

  • Node.js on your computer for the build: Vite 7 needs Node.js 20.19, 22.12 or newer.
  • History mode: createWebHistory needs a server-side fallback rule; createWebHashHistory doesn’t.
  • The base path: set base in vite.config.js when the app isn’t at the domain root.
  • Build-time variables: anything prefixed VITE_ is inlined and visible to visitors, so keep secrets out.
  • An API: if the app saves data it needs a server, such as PHP on any plan or Node.js on AI plans.

Example: a Vue app in a subfolder

If the app will live at example.com/app/, set the base path:

// vite.config.js
export default defineConfig({
  plugins: [vue()],
  base: '/app/',
})

// src/router/index.js
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
})

Then create an .htaccess file inside public_html/app/:

RewriteEngine On
RewriteBase /app/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /app/index.html [L]

At the domain root, use / instead of /app/ on both lines. These rules are explained in what is .htaccess.

Deploying, in short

  1. Run npm ci && npm run build, then check the result locally with npm run preview.
  2. Zip the contents of dist, upload to public_html in the File Manager and extract.
  3. Add the .htaccess file if you use createWebHistory.
  4. Open an inner page and refresh it to confirm routing works.

The same steps are covered in detail for Vite apps in the React deployment guide, and general uploading in the HTML upload guide. To run Nuxt in SSR mode, follow the Node.js deployment guide with .output/server/index.mjs as the startup file.

What every account includes

  • LiteSpeed, which serves static files directly and reads .htaccess rules.
  • Free SSL issued automatically, daily JetBackup backups and Imunify360 security.
  • Each account isolated in CloudLinux CageFS, and deploys from GitHub through Git Version Control and .cpanel.yml.
  • On AI plans: SSH and Node.js 20 and 24 for building on the server, plus Claude Code and Codex over SSH.
  • The Araby AI assistant in the panel, which reads error logs and explains the fix, plus support in Arabic.

Limits to know

  • Shared hosting doesn’t run Node.js, so build on your computer. Nuxt in SSR mode needs an AI/Developer plan.
  • A single-page app’s content appears only after JavaScript runs. If search visibility matters, use nuxi generate to produce ready-made HTML pages.
  • No root access and no Docker, and resources are limited per plan.

On ArabyHost

For a static Vue app, any hosting plan on the pricing page will do. If you need Nuxt in SSR mode or a Node.js API, pick one of the AI/Developer plans.

FAQ

Should I use createWebHistory or createWebHashHistory?

createWebHistory gives clean URLs like /about and needs an .htaccess rule. createWebHashHistory puts a # in the URL and needs no server setup, but it's less friendly to search engines.

Does Nuxt run on ArabyHost?

Yes, in two ways: nuxi generate produces a static site that runs on any plan, while Nuxt in SSR mode runs as a Node.js app on the AI/Developer plans.

My project is on Vue 2. Will it work?

Yes, the build output is static files like any other project. But Vue 2 reached end of life at the end of 2023 and gets no security fixes, so plan a move to Vue 3 and Vite.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.