cPanel
This guide walks you through deploying WeaveAI on cPanel based shared hosting.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- Web hosting with cPanel as the control panel
- Node.js Selector or Setup Node.js App feature available in cPanel
- PostgreSQL v17 support (check with your hosting provider)
- Domain configured and pointed to your cPanel server
- Terminal access (optional, only needed for npm commands - see alternatives below)
Install Node.js
Section titled “Install Node.js”cPanel typically provides Node.js through the “Setup Node.js App” feature.
-
Log in to cPanel
-
Navigate to “Setup Node.js App”
-
Create a Node.js application
- Click “Create Application”
- Node.js version: Select
22.xor24.x - Application mode: Select
Production - Application root: Enter the path where you’ll upload your application (e.g.
weaveai) - Application URL: Select your domain or subdomain
- Application startup file: Enter
build/index.js
-
Click “Create”
Environment Variables
Section titled “Environment Variables”On the same page under Environment variables, add the following variables:
DATABASE_URL- Add the connection string to your PostgreSQL database (we haven’t created the database yet so leave it empty for now). The format is like this:postgresql://cpanelusername_weaveai_user:password@localhost:5432/cpanelusername_weaveai_dbAUTH_SECRET- Generate a secret at auth-secret-gen.vercel.app and paste it herePUBLIC_ORIGIN- Your domain or sub-domain including thehttps://BODY_SIZE_LIMIT-104857600
Set Up PostgreSQL Database
Section titled “Set Up PostgreSQL Database”-
Navigate to PostgreSQL Databases
In cPanel, find and click “PostgreSQL Databases” or “PostgreSQL Database Wizard”.
-
Create a new database
- Database name: Enter a name (e.g.,
weaveai_db) - Click “Create Database”
- Database name: Enter a name (e.g.,
-
Create a database user
- Username: Enter a username (e.g.,
weaveai_user) - Password: Generate a strong password
- Click “Create User”
- Username: Enter a username (e.g.,
-
Add user to database
- Select the user you just created
- Select the database you created
- Grant ALL PRIVILEGES
- Click “Add”
-
Note your database connection details
You’ll need these for your environment variables:
- Host: Usually
localhost(check cPanel or contact support if unsure) - Port: Usually
5432(default PostgreSQL port) - Database name: The name you created (e.g.
cpanelusername_weaveai_db) - Username: The user you created (e.g.
cpanelusername_weaveai_user) - Password: The password you set
- Host: Usually
Prepare Application Files
Section titled “Prepare Application Files”-
Create application directory using File Manager
- In cPanel, find and click “File Manager”
- Navigate to the app directory that was created when you created the Node.js app
- Click on “Upload”
- Upload the WeaveAI .zip file that contains the app files
-
Verify file structure in File Manager
In the
weaveaidirectory (or whatever you called it when you created the Node.js app), you should see:package.jsonsvelte.config.js- Other application files and folders
Configure SvelteKit Adapter
Section titled “Configure SvelteKit Adapter”WeaveAI must use the Node.js adapter for cPanel deployment. Let’s verify and configure this using File Manager.
-
Open the configuration file in File Manager
- In cPanel File Manager, navigate to the
weaveaidirectory - Locate and click on
svelte.config.js - Click “Edit” button in the toolbar
- Click “Edit” again in the confirmation dialog
- In cPanel File Manager, navigate to the
-
Verify the adapter configuration
Update your
svelte.config.jsfile on the first line, changeadapter-autotoadapter-node:
import adapter from "@sveltejs/adapter-auto"; // change this to @sveltejs/adapter-nodeimport { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
/** @type {import('@sveltejs/kit').Config} */const config = { preprocess: vitePreprocess(),
kit: { adapter: adapter(), },};
export default config;- Click “Save Changes” button
- Click “Close” to return to File Manager
-
Update package.json if adapter is missing
If
@sveltejs/adapter-nodewasn’t in the project:- In File Manager, open
package.json - Find the
devDependenciessection - Add this line (maintaining proper JSON formatting):
"@sveltejs/adapter-node": "^5.0.0",
- Save the file
- In File Manager, open
Install Dependencies and Build
Section titled “Install Dependencies and Build”This step requires running npm commands. You have two options: build on the server using Terminal, or build locally and upload.
Option A: Build on Server (Requires Terminal Access)
Section titled “Option A: Build on Server (Requires Terminal Access)”This is the most straightforward approach if you have terminal access.
-
Open Terminal in cPanel
- In cPanel, find and click “Terminal”
- You’ll see a command-line interface
-
Navigate to your application directory
Terminal window cd ~/weaveai -
Activate the Node.js environment
cPanel’s Node.js environment requires activation. The exact command is shown in your “Setup Node.js App” interface. Look for a command like:
Terminal window source /home/cpanelusername/nodevenv/weaveai/22/bin/activateUpdate
22with24if you installed Node.js v24. Copy the exact command from your Node.js App page and run it. You should see your terminal prompt change to indicate the Node.js environment is active. -
Install dependencies - While the the app directory where the files are (e.g.
weaveaior whatever you called the directory), run this command:Terminal window npm installThis may take 3-10 minutes depending on your hosting provider’s resources. Wait for it to complete.
-
Build the application
Terminal window npm run buildThis creates the production build in the
build/directory. It may take a few minutes.
Option B: Build Locally and Upload (No Terminal Required)
Section titled “Option B: Build Locally and Upload (No Terminal Required)”If you don’t have terminal access or encounter memory issues, build on your local computer and upload the built files.
-
Build on your local computer
On your local machine where you have Node.js installed:
Terminal window # Navigate to your WeaveAI projectcd /path/to/weaveai# Install dependenciesnpm install# Build for productionnpm run build -
Prepare files for upload
You need to upload two things:
- The
build/directory (production build) - The
node_modules/directory (production dependencies)
- The
-
Compress the directories
- Compress
build/intobuild.zip - Compress
node_modules/intonode_modules.zip
- Compress
-
Upload using cPanel File Manager
- In cPanel File Manager, navigate to
weaveai/ - Click “Upload”
- Upload
build.zipandnode_modules.zip - After upload completes, return to File Manager
- Right-click
build.zip, select “Extract”, confirm - Right-click
node_modules.zip, select “Extract”, confirm - Delete both
.zipfiles to free space
- In cPanel File Manager, navigate to
-
Verify the upload
In File Manager, verify you now have:
build/directory withindex.jsinsidenode_modules/directory with many package folders
Push Database Schema
Section titled “Push Database Schema”The database schema must be pushed to create all necessary tables. You can do this on the server or locally.
Option A: Push Schema on Server (Requires Terminal)
Section titled “Option A: Push Schema on Server (Requires Terminal)”If you have terminal access and built on the server:
-
Open Terminal and navigate to your app
Terminal window cd ~/weaveaisource /home/cpanelusername/nodevenv/weaveai/22/bin/activate -
Push the database schema
Terminal window npm run db:pushThis creates all necessary database tables and relationships. Confirm when prompted.
Option B: Push Schema Locally (No Server Terminal Required)
Section titled “Option B: Push Schema Locally (No Server Terminal Required)”Follow the Database Schema guide to push your schema using Drizzle. Once that has been done, come back on this page to finish the guide.
Restart the Node.js app so all of our changes take effect
Section titled “Restart the Node.js app so all of our changes take effect”-
Return to “Setup Node.js App” in cPanel
Navigate back to the Node.js application manager in cPanel.
-
Edit your application
Find your WeaveAI application in the list and click “Edit”.
-
Start the application
Click “Start App” or “Restart” if already running.
Set Up Domain/Subdomain
Section titled “Set Up Domain/Subdomain”cPanel’s “Setup Node.js App” feature typically handles domain routing automatically. However, if your application isn’t accessible at your domain, you may need to configure a reverse proxy. Also, keep in mind that your domain needs to have an SSL certificate in order for WeaveAI to function.
Set Up SSL
Section titled “Set Up SSL”-
Navigate to SSL/TLS Manager in cPanel
-
Enable SSL for the domain where WeaveAI is installed
-
Restart your Node.js application
Updating WeaveAI
Section titled “Updating WeaveAI”When a new version of WeaveAI is released, you’ll need to update your installation. Choose the method that works best for you.
Method 1: Manual Upload (Recommended for Most Users)
Section titled “Method 1: Manual Upload (Recommended for Most Users)”This method doesn’t require terminal access and is the most reliable for shared hosting.
-
Build the update on your local computer
On your local machine:
Terminal window # Navigate to your WeaveAI projectcd /path/to/weaveai# Pull latest changes (if using Git)git pull origin main# Install any new dependenciesnpm install# Build for productionnpm run build# Install production dependencies only (to reduce upload size)npm install --production -
Backup current installation
- In cPanel File Manager, navigate to the
weaveaidirectory - Right-click the
buildfolder - Select “Compress”
- Save as
build-backup-YYYY-MM-DD.zip(use current date) - This allows you to restore if something goes wrong
- In cPanel File Manager, navigate to the
-
Upload updated build
- On your local computer, compress the new
build/directory tobuild.zip - In cPanel File Manager, navigate to
weaveai/ - Delete the old
build/directory (select it and click “Delete”) - Click “Upload” and upload the new
build.zip - Right-click
build.zip, select “Extract” - Delete
build.zipafter extraction
- On your local computer, compress the new
-
Upload updated dependencies (if package.json changed)
- Compress your updated
node_modules/directory tonode_modules.zip - In File Manager, delete the old
node_modules/directory - Upload and extract
node_modules.zip - Delete the
.zipfile
- Compress your updated
-
Upload any modified source files
If you’ve made configuration changes or updates to source files:
- Upload individual files via File Manager or FTP/SFTP
- Replace the old versions
-
Update database schema (if needed)
If the update includes database changes:
- Check the release notes for schema changes
- On your local machine (with your cPanel database credentials in
.env):Terminal window npm run db:push - Or use terminal on the server if available
-
Restart the application
- Navigate to “Setup Node.js App” in cPanel
- Find your WeaveAI application
- Click “Restart”
-
Verify the update
- Visit your application in a browser
- Check that everything works correctly
- If there are issues, restore from your backup
Method 2: Using Git and Terminal (For Advanced Users)
Section titled “Method 2: Using Git and Terminal (For Advanced Users)”This method requires terminal/SSH access and is faster but needs more server resources.
-
Access Terminal
- In cPanel, open “Terminal”
-
Navigate to your application
Terminal window cd ~/weaveai -
Activate Node.js environment
Terminal window source /home/cpanelusername/nodevenv/weaveai/22/bin/activate -
Backup current build
Terminal window cp -r build build-backup-$(date +%Y-%m-%d) -
Pull latest changes
Terminal window git pull origin main -
Install updated dependencies
Terminal window npm install -
Rebuild the application
Terminal window npm run build -
Update database schema (if needed)
Terminal window npm run db:push -
Restart application
- Navigate to “Setup Node.js App” in cPanel
- Click “Restart” on your application