# Vue.js App Hosting: Deploy Vue Projects in One Command
**Primary keywords:** vue.js hosting, vuejs cloud hosting, deploy vue app, nuxt hosting, vue production hosting —– Vue.js strikes a balance between approachability and capability that few frameworks match. https://apexweave.com/blog/managed-cloud-hosting Whether you're building a Composition API-based SPA, a Nuxt SSR application, or a Vite-powered single page app, Vue's ecosystem has matured into a production-ready choice for frontend development. wordpress hosting for developers This guide covers hosting Vue.js applications in production — from simple SPAs to full-stack Nuxt deployments. ## Vue Application Types and Their Hosting Needs Vue apps fall into two broad categories, each with different hosting requirements: **Client-Side SPAs (Vite + Vue):** Compile to static files. https://apexweave.com/blog/heroku-git-alternative Need a web server that handles SPA routing (redirect all routes to `index.html`). **Nuxt SSR Applications:** Require a running Node.js server for server-side rendering. Need proper cloud hosting with process management. ## Deploying a Vite Vue SPA ### Project Setup ```bash npm create vite@latest my-vue-app — —template vue-ts cd my-vue-app npm install ``` ### vite.config.ts ```typescript import defineConfig from 'vite'; import vue from '@vitejs/plugin-vue'; import resolve from 'path'; export default defineConfig( plugins: [vue()], resolve: alias: '@': resolve(__dirname, 'src'), , , build: outDir: 'dist', , ); ``` ### Procfile ``` web: npm run build && npx serve dist -s -l $PORT ``` The `-s` flag enables SPA mode — all routes serve `index.html`. ### Environment Variables ```bash # VITE_ prefix for client-exposed variables apexweave env:set VITE_API_BASE_URL=https://api.yourdomain.com apexweave env:set VITE_APP_VERSION=1.0.0 ``` In Vue components: ```typescript // src/composables/useApi.ts const API_BASE = import.meta.env.VITE_API_BASE_URL; export function useApi() async function getUsers() const res = await fetch(`$API_BASE/users`); return res.json(); return getUsers ; ``` ### Deploy ```bash apexweave login apexweave deploy ``` ## Vue Router Configuration ```typescript // src/router/index.ts import createRouter, createWebHistory from 'vue-router'; const router = createRouter( history: createWebHistory(import.meta.env.BASE_URL), routes: [ path: '/', component: () => import('@/views/HomeView.vue') , path: '/about', component: () => import('@/views/AboutView.vue') , path: '/dashboard', component: () => import('@/views/DashboardView.vue') , ], ); export default router; ``` ## Pinia State Management ```typescript // src/stores/users.ts import defineStore from 'pinia'; export const useUserStore = defineStore('users', state: () => ( users: [] as User[], loading: false, ), actions: async fetchUsers() this.loading = true; try const res = await fetch(`$import.meta.env.VITE_API_BASE_URL/users`); this.users = await res.json(); finally this.loading = false; , , ); ``` ## Deploying Nuxt.js (SSR) Nuxt requires a Node.js server for SSR. See the dedicated Nuxt.js hosting guide for full details, but briefly: ### nuxt.config.ts ```typescript export default defineNuxtConfig( runtimeConfig: // Server-only secrets databaseUrl: process.env.DATABASE_URL, // Exposed to client public: apiBase: process.env.NUXT_PUBLIC_API_BASE , , ); ``` ### Procfile for Nuxt ``` web: npm run build && node .output/server/index.mjs ``` ```bash apexweave env:set NUXT_PUBLIC_API_BASE=https://api.yourdomain.com apexweave env:set DATABASE_URL=postgres://user:pass@host:5432/mydb apexweave deploy ``` ## Vue Component Example ```vue wordpress git deployment hosting — src/components/UserCard.vue —>
user.name
user.email
Select
interface User id: number; name: string; email: string; avatar: string; defineProps< user: User >(); defineEmits< select: [user: User] >(); .user-card border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; ``` ## Streaming Logs ```bash apexweave logs —follow ``` Server access logs and any console errors from your serving process stream here. ## SSH Access ```bash apexweave ssh # Check the build output ls dist/ # Verify bundle sizes du -sh dist/assets/* ``` ## Custom Domain ```bash apexweave domain:add app.yourdomain.com ``` After setting a custom domain, remember to update your `VITE_API_BASE_URL` environment variable and redeploy so the bundle picks up the new API URL. ## Optimizing Vue Builds ```typescript // vite.config.ts export default defineConfig( build: rollupOptions: output: manualChunks(id) if (id.includes('node_modules')) id.includes('vue-router')) return 'vue-vendor'; return 'vendor'; , , , , ); ``` ## Vue with TypeScript Vue 3's Composition API and TypeScript work beautifully together:
```typescript // src/composables/useFetch.ts import ref, type Ref from 'vue'; export function useFetch(url: string) const data: Refwordpress hosting africa That joy should extend to deployment. With ApexWeave, a `git push` workflow via `apexweave deploy` means your Vue app goes from local to production without touching server configuration. deploy app from github hosting Start your **free 7-day trial on ApexWeave** today. Your Vue app deserves production-grade infrastructure — and you deserve to spend your time writing components, not configuring servers.