Deploy vite frontend to coolify
Learn how to deploy a vite project in coolify
vite.config.ts
This file is important to define which port will your site running on, in this case it will be 5177
export default defineConfig({
plugins: [...],
server: {
port: 5177, // Specify your desired port here
host: true, // Allow external connections
allowedHosts: true // Allow all hosts
},
preview: {
port: 5177, // Same port for preview server
host: true, // Allow external connections
allowedHosts: true // Allow all hosts
}
});
Deploy to coolify
You will choose to add a new resource with github, leave the default configuration with nixpacks. And specify the same port as before in the field Port exposes
On the main configuration of the resource are some needs that need to be changed. (Assuming these are the same that you have on your package.json)
Install Command: npm install
Build Command: npm run build
Start Command: npm run preview
Base directory: (Optional, Ex: /frontend)
Port Exposes: 5178 (Should already be set)
Ports Mappings: 5178:5178
Set the env variables
When everything is set click deploy and the site should be deployed properly
Related Posts
Register domain with cloudflare and deploy it to coolify
quick guide on how to register a domain with cloudflare and deploy it to coolify
How to Manage SQLite Databases on a VPS ( with Coolify )
The Problem Keeping a SQLite database consistent between a Docker‑based VPS and local development requires a shared persistent volume, correct path...
Deploy Astro site to coolify
Small guide on how to deploy an astro site on mode server to coolify
Let's connect !!
Get in touch if you want updates, examples, and insights on how AI agents, Langchain and more are evolving and where they’re going next.