Host Node.js Apps in cPanel Pods with Podman – A Guide
Deploy Node.js apps with cPanel Podman integration. Learn to build, run, and manage secure containers via UI or CLI.
6 min read
Running Node.js applications inside isolated containers lets you deploy, scale, and manage code without worrying about dependency clashes or server‑level changes. With cPanel’s recent Podman integration, you combine the familiar cPanel UI with root‑less containers, making it easier for developers and hosting providers to serve modern web apps on shared or VPS environments.
Why Use Podman with cPanel for Node.js?
Root‑less security: Podman runs containers without root privileges, reducing the attack surface.
cPanel convenience: A “Containers” section appears in the dashboard, letting users start, stop, and view logs without leaving the familiar interface.
Isolation: Each Node.js app gets its own filesystem, network namespace, and resource limits, preventing interference between apps.
Portability: Container images can be moved between servers or environments, simplifying migrations and backups.
Prerequisites
A server running cPanel ® (version 108 or later) with root access.
Internet connectivity to pull the official node image from Docker Hub.
A basic understanding of Node.js project structure (e.g., package.json, app.js).
1. Install Podman on Your Server
cPanel does not ship Podman by default, so install it manually. The following commands work for the two most common Linux families used with cTable.
Debian / Ubuntu (apt)
# Update the package index
apt update
# Install Podman and the Docker‑compatibility layer
apt install -y podman podman-docker
# Verify the installation
podman --version
apt update refreshes the package list. apt install pulls Podman and podman-docker, which lets Docker‑style commands work with Podman. The final line confirms the installed version.
AlmaLinux / Rocky Linux / RHEL (dnf)
# Enable the CRB repository required for some dependencies
dnf config‑manager --set-enabled crb
# Install Podman
dnf install -y podman
# Verify the installation
pod
The CRB repository provides packages that Podman may need. dnf install fetches the latest stable Podman release, and the version check ensures the binary is available.
2. Enable cPanel’s Podman Integration
After Podman is installed, activate the integration inside WHM.
Log in to WHM as root.
Navigate to Home → Plugins → Podman Integration.
Click Enable Integration. A default podman systemd service is created and the cphulkd user is added to the podman group, allowing cPanel accounts to manage containers.
Restart the service: systemctl restart podman.
Once enabled, every cPanel user will see a new “Containers” icon in their dashboard, providing a simple UI for creating and controlling containers.
3. Create a Node.js Container Image
Building a small custom image keeps only the needed dependencies, reducing the attack surface and startup time.
Dockerfile
# Start from a lightweight Alpine‑based Node.js 20 image
FROM node:20-alpine
# Set the working directory
WORKDIR /app
# Copy package files first for layer caching
COPY package*.json ./
# Install production dependencies
RUN npm ci --only=production
# Copy the rest of the application
COPY . .
# Expose the port the app listens on
EXPOSE 3000
# Start the application
CMD ["node", "app.js"]
Explanation of key lines:
FROM node:20-alpine – minimal base image.
WORKDIR /app – creates and switches to /app.
COPY package*.json . – copies package.json and package‑lock.json.
RUN npm ci --only=production – installs exact versions, skipping dev dependencies.
EXPOSE 3000 – informs Podman that the container will listen on port 3000.
CMD ["node", "app.js"] – command executed when the container starts.
Build the Image
# Navigate to the directory containing your Dockerfile
cd /home/username/node-project
# Build the image; replace my‑node‑app with your preferred name
podman build -t my-node-app:latest .
# List local images to verify
podman images
The podman build command reads the Dockerfile, creates layers, and tags the resulting image as my-node-app:latest. The podman images command shows all locally stored images.
4. Deploy the Container from cPanel
With the image ready, launch it through the cPanel UI or via the command line. The UI is useful for non‑technical users; the CLI is handy for automation.
Click Launch. The container status will change to “Running”.
Visit http://yourdomain.com:8080 to see the app.
CLI Alternative (for automation or SSH users)
# Create a systemd‑managed pod (recommended for restart policies)
podman pod create --name nodepod -p 8080:3000
# Run the container inside the pod
podman run -d \
--name nodeapp \
--pod nodepod \
-e NODE_ENV=production \
my-node-app:latest
# Check status
podman ps -a
The pod create command defines a pod named nodepod that maps host port 8080 to container port 3000. The run command starts the container in detached mode (-d) inside that pod and sets an environment variable.
5. Manage Resources and Security
cPanel’s integration allows basic limits, and Podman offers finer control.
CPU and Memory Limits
# Example: limit to 1 CPU core and 512 MiB RAM
podman run -d \
--name nodeapp \
--pod nodepod \
--cpus 1 \
--memory 512m \
-e NODE_ENV=production \
my-node-app:latest
--cpus 1 restricts the container to one CPU share; --memory 512m caps RAM usage.
Read‑Only Filesystem (optional)
# Make the container’s root filesystem read‑only
podman run -d \
--name nodeapp \
--pod nodepod \
--read-only \
-v /app/logs:/app/logs:rw \
my-node-app:latest
Setting --read-only improves security by preventing accidental writes. Writable paths (e.g., a logs directory) must be mounted explicitly with -v.
Automatic Restarts
# Restart policy for resilience
podman run -d \
--name nodeapp \
--pod nodepod \
--restart=unless‑stopped \
my-node-app:latest
The unless‑stopped policy restarts the container on failure or system reboot, unless you manually stop it.
6. Updating Your Application
Redeploy new code without downtime by following these steps.
Pull the latest source (e.g., git pull in /home/username/node‑project).
Start a new instance with the updated image (same command used originally).
Because the container is recreated, the new code runs immediately while the old container is cleanly removed.
Conclusion
cPanel’s Podman integration bridges traditional shared‑hosting workflows and modern container‑based development. By installing Podman, building a lightweight Node.js image, and managing containers through either the cPanel UI or straightforward CLI commands, you can deliver isolated, secure, and easily updatable applications on AtoZNode’s VPS or dedicated servers. The same process scales from a single test app to dozens of micro‑services, all while keeping the familiar cPanel experience for end users.