🖥️ Step-by-Step Migration to OpenLiteSpeed (No Control Panel)
 Add a New User
useradd -m username -s /bin/bash
 useradd: Adds a new user to the system.
-m: Creates a home directory for the user (e.g., /home/username)
-s /bin/bash : Sets the default shell for the user to /bin/bash.
Sets directory permissions:
chmod 751 /home/username
 Owner has full access (7),
Group has read and execute (5),
Others can only execute (1) — needed for the web server to traverse the directory.
Set Up Web Root Directory
mkdir -p /home/username/domain.tld/{public_html,logs}
-p: Creates the whole directory path if it doesn’t exist.
domain.tld/public_html : Where your website files go.
domain.tld/logs: For storing access/error logs.
Correct the ownership Web Root Directory
cd /home/username/ chown username. * -R
Changes ownership of all files in /home/username to the user username.
* -R : Recursively applies to all files and folders.
Restore Website Files from cPanel Backup
Navigates into the public web directory where files will be restored.
cd /home/username/domain.tld/public_html/
Downloads the cPanel backup file from your server
wget http://<your-server-ip>/cpmove-username.tar.gz
Replace <your-server-ip> with your actual server’s IP.
Extracts the `.tar.gz` archive and shows a list of files being extracted.
tar -xvf cpmove-username.tar.gz
Deletes the empty public_html directory and moves the extracted website files into place
rm -rf public_html mv cpmove-username/homedir/public_html .
Deletes the empty `public_html` directory created earlier.
Moves the extracted real website files into place.
Correct the ownership and group for Web Root Directory
chown username. * -R
Ensures the extracted files belong to the correct system user.
Configure OpenLiteSpeed Virtual Host
File to edit:Â /usr/local/lsws/conf/httpd_config.conf
Add a new virtualhost and listener mapping for ports 80 and 443, just like other domains already configured.
Create vhost config:
mkdir -p /usr/local/lsws/conf/vhosts/domain.tld/ vim /usr/local/lsws/conf/vhosts/domain.tld/vhost.conf
 Use existing vhost.conf files in /usr/local/lsws/conf/vhosts/ as a template.
make sure set correct permissions and ownership for the OpenLiteSpeed vhost.conf file
Setup MySQL Database and User
Creates a new MySQL database.
CREATE DATABASE DATABASENAME;
Creates a MySQL user who can only connect from the local machine.
CREATE USER 'DATABASEUSERNAME'@'localhost' IDENTIFIED BY 'PASSWORD';
Grants full permissions on the database to that user.
GRANT ALL PRIVILEGES ON DATABASENAME.* TO 'DATABASEUSERNAME'@'localhost';
Reloads the privilege tables so that changes take effect.
FLUSH PRIVILEGES;
Imports your SQL file into the new database.
mysql DATABASENAME < /path/to/database.sql
Generate SSL with acme.sh (Cloudflare DNS)
Navigate to the directory where acme.sh is installed.
cd ~/.acme.sh/
Issue SSL for the domain
./acme.sh --issue -d dommin.tld -d *.dommin.tld --dns dns_cf --reloadcmd "systemctl restart lsws;"
–issue: Starts the certificate issuance process.
-d domain.tld -d *.domain.tld`: For both root and wildcard subdomains.
–dns dns_cf: Uses Cloudflare’s DNS API for validation.
–reloadcmd: Reloads OpenLiteSpeed after issuing the certificate.
Summary / Conclusion
This guide walks you through migrating a website to a non-panel server running OpenLiteSpeed, covering every major aspect from system user creation to SSL setup.
What we Accomplished:
- Created a dedicated system user with secure permissions.
- Set up the directory structure (public_html, logs) for hosting the website.
- Restored a cPanel backup manually using shell commands.
- Configured OpenLiteSpeed by adding new virtual host entries and mapping ports 80/443.
- Imported the MySQL database and set up user privileges securely.
- Enabled SSL encryption with a free Let’s Encrypt certificate using acme.sh