Everything I’ve Accomplished to Move My Website from Shared Web Hosting in Europe to Unmanaged VPS in Dallas, United States. From A to Z – AlmaLinux, CyberPanel, and OpenLiteSpeed: Installation, Updates, Website Migration, DNS Management, SSL Certificate, Email Setup, Optimization, Backup, Security, and How Many Unique Visitors Per Second My VPS Can Handle. These Steps Apply to Both Dedicated Servers and Virtual (VPS) Servers.
This article is about all the things I did to move my website from shared web hosting in Europe to unmanaged VPS in the United States, Dallas. From A to Z – AlmaLinux, CyberPanel, and OpenLiteSpeed: installation, update, website migration, DNS, SSL certificate, email, optimization, backup, security, and testing unique visitors per second. These things apply to both dedicated servers and virtual private servers (VPS).
Before choosing the current web hosting company in Dallas, where I moved, I checked hundreds of other options in the United States and Canada that offered anything from VPS to dedicated servers at decent prices. I didn’t choose a cheap dedicated server, even though I found some attractive offers, around $20 per month for an 8-core entry-level processor, 16GB RAM, and SSD, because either the hardware was very old, older than ten years, which could fail at any time, and/or the locations where the dedicated servers were located were not optimal for fast loading across the USA.
I chose a company that offers VPS at decent prices because it met almost all the qualities I look for in a web hosting business: decent prices, modern and sufficient hardware for my needs, their website loads quickly, they have a phone number, they are a registered company in the US, they have good reviews on Trustpilot, and they respond relatively quickly to support requests. I also wanted it to be a small company because they focus best on the client. I’m not a big fan of web hosting corporations because even the little guy needs to eat. In the ten years since I’ve had my blog, I’ve always done well with smaller hosting companies, even ones run by a single person.
The only thing I didn’t like about absolutely all the companies I contacted regarding a VPS was that not even one of them responded to my email when I asked if they offered initial VPS configuration and migration. I had to insist to receive a negative response. It’s not a problem if they don’t offer initial VPS configuration since it’s an unmanaged server, and we’re all adults, we can figure it out, but it’s impolite not to respond at all to a potential client. I wanted to give them money, not take it away. Do these companies have so many clients that they can afford not to respond to a potential client? Even though I’ve been on shared hosting my whole life, being passionate about technology, I know at least in theory everything I need to do to configure and migrate a website. What I don’t know, I search for… what I can’t find, I search again… and I don’t give up. It’s just that a professional sysadmin would do things much faster than me.
That’s why I don’t even want to mention the name of the hosting company I moved to because they only responded after I insisted with a second email, hinting that they have an almost perfect score on Trustpilot and it shouldn’t be ruined. As if they were paying me, not the other way around. It would have been simple for them to say from the beginning that they don’t offer management services because I’m an educated person with whom they can communicate. I don’t like being ignored, and I don’t react well to it either.
Also, advertising costs. In the past, I used to advertise web hosting companies without receiving anything, but in the meantime, I’ve become less unintelligent. I’ve become a bit smarter than in the past. They didn’t help me with anything except taking my money, so why I should promote them? I managed everything that needed to be done, and they just handed me the VPS. I understand that server management services are expensive and time-consuming, but it’s like burning them with fire when you ask those who offer unmanaged VPS if they will help you with website installation and migration.
If I’ll ever have a web hosting company, I will assist all my clients with configuring and migrating their websites.
Anyway, let’s get back to why I chose Dallas and what this city means to me. I chose it primarily because it’s centrally located in the United States, so it can serve both the West Coast and the East Coast of America well.
Besides this important fact, in Europe, Dallas means, for people like me at least in their late 30s, the TV series of the same name that was very popular here. Everyone used to watch Dallas in the early 90s, the Ewing family, their ranch, and their oil business. As a child during that time, I was in love with Pamela (Victoria Principal). More recently, Dallas has meant the streamer Murda on Twitch for me, and the drag racing events he broadcasts from Dallas, at the Yello Belly Drag Strip.
Even though I was born and raised in the capital of my country, I always looked forward to the 3-month summer vacation to visit my grandparents in the countryside. If I will ever live in the United States, most likely the chosen place would be something like Dallas, Texas… not New York, as I’m more attracted to the locations and way of life of the people in the southern United States than those in the north. If I won’t move to the US, perhaps I’ll have the opportunity to visit the Ewing family’s ranch in Dallas and the Yello Belly drag racing track.
Returning to the transfer of my blog from shared hosting to unmanaged VPS in the USA, I managed quite well with the migration, optimization, and security of my virtual server, even though I encountered some issues, such as IP mapping in the OpenLiteSpeed web server and the fact that CyberPanel seems to have a problem with uploading large files using its file manager.
Now, I want to mention all the steps I took to move my website to the new hosting. If I forgot something, I will update the article, or you can ask me if you have any questions.
From A to Z – AlmaLinux, CyberPanel, and OpenLiteSpeed:
Installation and update of AlmaLinux. I chose AlmaLinux 8 because it is a Linux distribution based on Red Hat Linux, just like CentOS, but unlike CentOS, it will have support for many years to come, as CentOS will reach its “end of life (EOF)” in 2024. I didn’t have to install AlmaLinux because I selected it when purchasing the VPS, and it came with the preinstalled Linux distribution.
I only had to update it in SSH with PuTTY using the command “sudo dnf update” and for the upgrade, “sudo dnf upgrade“. The update didn’t take long because the VPS has 6 cores at 3.2GHz, 16GB RAM, 120GB NVMe, and a gigabit internet connection.
Installation of CyberPanel plus OpenLiteSpeed web server, Redis, and configuration. The installation of the free control panel, CyberPanel, took a bit longer because the download speed of certain components from GitHub was extremely slow, around 3-5KB/s. I’ve seen faster speeds on dial-up when it comes to GitHub, which means Microsoft, so you can’t expect too much from them. I remember having a Lumia smartphone with Windows on it (well, Windows Mobile was still Linux), and the applications downloaded from Microsoft had very slow speeds most of the time.
When installing CyberPanel, depending on your preferences, you can choose LiteSpeed Enterprise web server, which is free for a single site but has a limit of 2GB RAM for the VPS or dedicated server you want to use, or you can choose OpenLiteSpeed web server, which is completely free. I opted for the latter and also chose to install Redis for caching. After installation, I connected to CyberPanel using IP:8090, logged in, and selected the appropriate PHP version for my blog, which was 7.4. Then, I headed to “packages” because you need to create a package for your site before creating a website. Next, I went to “websites” and created a website, filling in and selecting all the options there, except for “Apache as Reverse Proxy (Beta, for Ubuntu 22 and AlmaLinux 8)” because I didn’t need that.
Migrating WordPress blog from shared hosting with cPanel to unmanaged VPS. The next step was to start migrating my site from the old shared hosting with cPanel to the new VPS with CyberPanel.
So, I went to the old hosting, made a full backup of the site, then deactivated the W3 Total Cache and Cloudflare plugins, and paused the CDN/Cloudflare protection. After that, I went to the file manager in cPanel, selected all the files in public_html, created a zip archive, and downloaded it to my laptop. Since I couldn’t upload the files to the VPS using the file manager in CyberPanel due to a bug, I had to create an FTP account and configure FileZilla client to upload the backup zip archive to the server.
Then, I noticed that CyberPanel uses MariaDB while I had MySQL in cPanel. However, it wasn’t a problem because both database management systems are compatible. I went to cPanel’s phpMyAdmin and exported the blog’s database, then created a new database in CyberPanel and imported my database into it. I made sure to modify all the necessary details in wp-config.php to match the database with the WordPress files.
DNS Configuration. The next step should have been configuring the nameservers and DNS zones.
This can be easily done in CyberPanel, and then you just need to update the DNS at your domain registrar. I didn’t have to create DNS records because I was already using Cloudflare nameservers, so all I had to do was manually modify the new dedicated IP of my VPS in the DNS/records zone in Cloudflare, and within seconds, I moved from the old web hosting in Europe to the one in the United States. I didn’t had to wait for the DNS to propagate.
Issue a new SSL certificate. If when creating a new site in CyberPanel, the nameservers are not pointing to the new hosting, CyberPanel will generate a basic SSL certificate that is not recognized by web browsers like Google Chrome. Therefore, you need to go to the SSL section in CyberPanel, select your site, and issue a new Let’s Encrypt SSL certificate. It is valid for 90 days, and CyberPanel will automatically handle its renewal. If you don’t do this, when you visit your site, you will be greeted with a warning that the site is insecure.
Email Configuration. It’s very easy to create an email address on your domain using CyberPanel, but you need to pay attention to a few things.
First, make sure to select your site when creating the email address, not a subdomain, as you don’t want to increase the length of your address with a subdomain (For example, choose “cik.ro” instead of “mail.cik.ro”).
To secure your email address, don’t forget to use DMARC, DKIM, and SPF options as TXT records in the DNS zone, as otherwise your email address might end up in blacklists and could be used for spam without your consent if you don’t configure these things.
Don’t forget to issue a Let’s Encrypt SSL certificate for mail.yourdomain.com in CyberPanel.
To avoid receiving spam emails, install and configure Apache SpamAssassin, as this option is available directly in CyberPanel. To read your emails, you already have a client installed in CyberPanel (SnappyMail), or you can use one directly on your computer, such as Mozilla Thunderbird or Microsoft Outlook.
How to do backups in CyberPanel. One of the most important things when it comes to not losing critical data, such as your entire website that you have worked so hard on, is creating a backup that you can download to your computer or upload to the cloud, especially if you’re using a self-managed VPS without backup. This can be easily done directly from the CyberPanel interface under Backup > Create Backup, which will create a backup copy of all your files that you can access using the file manager of your website at home/SiteName/backup.
Also, if you want to be even more secure, you can use the “dd” command line installed on AlmaLinux, or a free program that creates a system image with everything you have on the server, such as “Partclone”.
Optimizing website loading speed with LiteSpeed Cache plugin for WordPress. I have been using the W3 Total Cache WordPress caching plugin for many years, but as I mentioned the other day, when I moved to the new hosting, many of my images were randomly missing due to this plugin, and I had to manually resolve the image loss.
So, I decided to switch to the LiteSpeed Cache plugin because I knew that together with the OpenLiteSpeed web server, it represents the most efficient way to optimize your site for faster loading and to handle as many requests per second on the server as possible. I installed it and started configuring and testing it, and I am very satisfied with the results it has shown. The LiteSpeed Cache plugin has many options to make your site as fast as possible and has a modern interface. It also works very well with the Cloudflare plugin as long as you don’t use any conflicting options that could interfere with the CDN. Don’t be alarmed by the warning that they may not be compatible because they are.
Securing VPS and Website. Now, we have reached the part of securing the VPS and WordPress blog.
As a general rule, as long as you keep all the programs on your server up to date, including the AlmaLinux operating system, and use long passwords (20+ characters) for everything you have there, you should be fairly safe, as long as there are no zero-day vulnerabilities.
However, I believe there are certain things we can do to enhance the security of our server.
Here’s what I did:
- I disabled the FTP account since I no longer need it.
- I blocked access to the web interface of the OpenLiteSpeed web server from iptables. I could have done this from the OLS configuration file, but I chose this method, thinking that I would have quicker access to the OLS interface if needed. Remember that the rules set in iptables are reset when you reboot the VPS, so you need to create a file and a persistent process on the server that loads your iptables rules after each VPS reboot. As a pro tip, add a delay to the loading of files, around 10 seconds, to ensure they are loaded properly. To restrict the access to the default port used by OpenLiteSpeed web interface, I used this command “sudo iptables -A INPUT -p tcp –dport 7080 -j DROP”.
- I disabled SSH from CyberPanel/Security/Secure SSH since I still have access to it using my hosting company’s noVNC console. If I didn’t have access, well… that would be a problem because I would be locked out if something went wrong with CyberPanel. If you don’t have a noVNC console, it would be useful to create a second account with sudo privileges on the server.
- I enabled two-factor authentication (2FA) for the CyberPanel control panel.
- I restricted access to wp-login.php, allowing access only from my IP address. Honestly, I did all these things not because I’m afraid that my passwords could be guessed through brute-force, as they are over 20 characters long, but I’ve seen dedicated servers with CPUs at 100% usage due to numerous brute-force attempts on user logins, consuming all server resources.
- I restricted access to my blog to only my IP address and Cloudflare IP ranges. In other words, all traffic must pass through Cloudflare. This can be done in two ways:
Through .htaccess – a less useful and less professional way.
Order deny, allow
deny from all
allow from <MyIP>
allow from 173.245.48.0/20
allow from 103.21.244.0/22
allow from 103.22.200.0/22
allow from 103.31.4.0/22
allow from 141.101.64.0/18
allow from 108.162.192.0/18
allow from 190.93.240.0/20
allow from 188.114.96.0/20
allow from 197.234.240.0/22
allow from 198.41.128.0/17
allow from 162.158.0.0/15
allow from 104.16.0.0/13
allow from 104.24.0.0/14
allow from 172.64.0.0/13
allow from 131.0.72.0/22
allow from 2400:cb00::/32
allow from 2606:4700::/32
allow from 2803:f800::/32
allow from 2405:b500::/32
allow from 2405:8100::/32
allow from 2a06:98c0::/29
allow from 2c0f:f248::/32
Through iptables – a better and more professional way. However, be careful with what you do in iptables, so you don’t end up locking yourself out.
# Clear existing rules
sudo iptables -F
# Allow established connections
sudo iptables -A INPUT -m conntrack –ctstate RELATED,ESTABLISHED -j ACCEPT
# Allow traffic from Cloudflare IP ranges
sudo iptables -A INPUT -s <MyIP> -j ACCEPT
sudo iptables -A INPUT -s 173.245.48.0/20 -j ACCEPT
sudo iptables -A INPUT -s 103.21.244.0/22 -j ACCEPT
sudo iptables -A INPUT -s 103.22.200.0/22 -j ACCEPT
sudo iptables -A INPUT -s 103.31.4.0/22 -j ACCEPT
sudo iptables -A INPUT -s 141.101.64.0/18 -j ACCEPT
sudo iptables -A INPUT -s 108.162.192.0/18 -j ACCEPT
sudo iptables -A INPUT -s 190.93.240.0/20 -j ACCEPT
sudo iptables -A INPUT -s 188.114.96.0/20 -j ACCEPT
sudo iptables -A INPUT -s 197.234.240.0/22 -j ACCEPT
sudo iptables -A INPUT -s 198.41.128.0/17 -j ACCEPT
sudo iptables -A INPUT -s 162.158.0.0/15 -j ACCEPT
sudo iptables -A INPUT -s 104.16.0.0/13 -j ACCEPT
sudo iptables -A INPUT -s 104.24.0.0/14 -j ACCEPT
sudo iptables -A INPUT -s 172.64.0.0/13 -j ACCEPT
sudo iptables -A INPUT -s 131.0.72.0/22 -j ACCEPT
sudo ip6tables -A INPUT -s 2400:cb00::/32 -j ACCEPT
sudo ip6tables -A INPUT -s 2606:4700::/32 -j ACCEPT
sudo ip6tables -A INPUT -s 2803:f800::/32 -j ACCEPT
sudo ip6tables -A INPUT -s 2405:b500::/32 -j ACCEPT
sudo ip6tables -A INPUT -s 2405:8100::/32 -j ACCEPT
sudo ip6tables -A INPUT -s 2a06:98c0::/29 -j ACCEPT
sudo ip6tables -A INPUT -s 2c0f:f248::/32 -j ACCEPT
# Deny all other traffic
sudo iptables -A INPUT -j DROP
# Save the rules
sudo iptables-save > /etc/iptables/rules.v4
sudo ip6tables-save > /etc/iptables/rules.v6
Should I use mod_security or not? I’ve thought a lot about whether I should install mod_security in CyberPanel or not.
Pros: It protects against XSS (Cross-Site Scripting), SQL injection, and similar threats.
Cons: It slows down the website, and I prefer fast websites; it consumes hosting hardware resources; excessive security can be harmful.
I haven’t decided yet. I thought that since all traffic goes through Cloudflare, they have enough rules to prevent such issues.
And now comes the question: even if you secure your website quite decently, what if it still gets hacked?
Once you connect to the Internet, nothing is secure anymore, and anything can happen. If a zero-day vulnerability appears and someone unauthorized accesses my site, I’ll delete everything, upload the image of my system and update the vulnerable software to close the vulnerability, change all passwords, and here we go again, back into business.
How many unique users per second can my VPS handle? I decided to test it using the website loader.io, which, on a free account, allows you to send a maximum of 10K unique visitors in a minute, roughly around 166 per second. The first test wasn’t successful because Cloudflare blocked all the test IP addresses for DDoS attack reasons, so I had to disable Cloudflare and make another attempt. It handled 166 unique visitors per second without any issues.
With Cloudflare CDN enabled, optimized LiteSpeed Cache plugin, OpenLiteSpeed web server, along with a 6-core 3.29GHz processor, 16GB RAM, 120GB NVMe, gigabit connection, and a minimalist and well-optimized blog like mine, it should be able to handle at least a few hundred unique visitors per second.
At the end, I just want to write to you that anyone can migrate their website from shared hosting with cPanel to a self-managed VPS with CyberPanel without paying hundreds of dollars to a sysadmin for the migration.
Even though in the past I have installed virtual machines on Windows with Linux distributions such as Linux Mint and Ubuntu, or with another Windows for testing viruses and sending them to antivirus companies for detection, and even though I had a web server installed on my computer to locally modify the WordPress blog before adding it to shared hosting, I don’t have much experience with VPS or dedicated servers.
That’s because my entire life I have been hosted on shared hosting, where I enjoyed the comfort of cPanel and managed hosting. But, I can say that I managed quite well to migrate my website because I am passionate about IT, and even if I don’t know some things in practice, I know them in theory and know how to apply them.
So, don’t be afraid of the unknown and the new, because I’m sure that if in the future you also want to move from shared hosting to a VPS or dedicated server, you will manage. If you don’t know something, you can ask me, and depending on time and knowledge, I will answer you.
PS: What has been your experience with migrating from shared hosting to a VPS or dedicated server? Share your thoughts and any tips you have for a successful migration in the comments below!