If you have created a website and want to make it available online, you need two main things: a domain name and web hosting.
Hosting a website may sound technical at first, but the process is straightforward once you understand the basic steps. This guide explains how to host a website in Sri Lanka, from choosing a domain and hosting plan to uploading your website and enabling HTTPS.
What Do You Need to Host a Website?
Before publishing your website, you normally need:
A domain name
A web hosting account
Your website files or a CMS such as WordPress
DNS configuration
An SSL certificate
Once these are connected correctly, visitors can access your website through your domain name.
Step 1: Choose a Domain Name
Your domain name is the address people type into their browser to visit your website.
For example:
yourbusiness.com
Choose a domain that is:
Easy to remember
Easy to type
Related to your business or brand
Short where possible
Free from unnecessary numbers and symbols
Depending on your business, you may use extensions such as:
.com
.lk
.org
.net
Other available domain extensions
If you already own a domain, you can connect it to your new hosting account.
Step 2: Choose a Web Hosting Plan
Your hosting account stores your website files and makes them accessible through the internet.
For most new websites, shared hosting is a practical starting point.
Shared hosting is commonly suitable for:
Business websites
WordPress websites
Blogs
Portfolio websites
Landing pages
School websites
Small organisation websites
If your website requires more server resources or custom software, you may need VPS hosting instead.
Ceylon Web Servers offers shared hosting starting from Rs. 2,200 per year.
Step 3: Purchase Your Hosting Account
After selecting a hosting package, complete your order and payment.
Once your hosting account is activated, you should receive the information required to manage your hosting.
This may include:
Hosting control panel login
Server IP address
Nameservers
FTP information
Account username
Temporary password
Keep these details secure.
Step 4: Connect Your Domain to Your Hosting
If your domain and hosting are purchased from different providers, you need to point the domain to your hosting server.
There are usually two common methods.
Method 1: Change the Nameservers
Your hosting provider may give you nameservers similar to:
ns1.example.com
ns2.example.com
Log in to the company where your domain is registered and replace the existing nameservers with the nameservers provided by your hosting company.
DNS changes may take some time to update across the internet.
Method 2: Use an A Record
You can also point the domain directly to the hosting server's IP address.
A typical DNS configuration may contain:
A Record
Name:
@
Value:
Your Server IP Address
You may also create another record for:
www
Depending on your configuration, www may use an A record or CNAME.
Step 5: Log In to Your Hosting Control Panel
After your hosting account is activated, log in to the hosting control panel provided with your account.
The control panel allows you to manage many parts of your website without using server commands.
Depending on your hosting service, you may be able to manage:
Files
Databases
Email accounts
Domains
Subdomains
SSL certificates
Backups
PHP versions
DNS settings
Step 6: Upload Your Website Files
If your website was created using HTML, CSS, JavaScript, PHP, Bootstrap, or another web technology, you need to upload its files to your hosting account.
Open the File Manager in your hosting control panel.
Find the main website directory. Depending on the server configuration, this may be named something similar to:
public_html
Upload your website files into this directory.
Your main file will usually be:
index.html
or
index.php
For example:
public_html/
index.html
about.html
contact.html
css/
js/
images/Once the files are uploaded correctly and your domain is connected, your website should become accessible online.
Step 7: Upload a Website Using FTP
You can also upload website files using FTP software such as FileZilla.
Your hosting provider may give you:
FTP hostname
FTP username
FTP password
FTP port
Add these details to your FTP application and connect to the server.
Then upload your website files to the correct web root directory.
FTP can be useful when you need to upload many files at once.
Step 8: Create a Database If Your Website Needs One
Static HTML websites usually do not require a database.
Websites built using systems such as:
WordPress
Laravel
Custom PHP applications
eCommerce platforms
may require a MySQL or MariaDB database.
From your hosting control panel, create:
A database
A database user
A database password
Then assign the user to the database with the required permissions.
You will normally need these details:
Database Host
Database Name
Database Username
Database PasswordEnter them into your application's configuration file.
Step 9: Install WordPress
If you want to create a website without developing it from scratch, WordPress is a popular option.
Depending on your hosting control panel, WordPress may be available through an automatic installer.
The basic installation process usually requires:
Your domain
Website title
Administrator username
Administrator password
Administrator email address
Once installation is complete, you can normally access your WordPress dashboard through:
yourdomain.com/wp-admin
From there, you can install themes, plugins, create pages, and manage your website.
Step 10: Enable SSL and HTTPS
After connecting your domain, enable an SSL certificate.
SSL allows your website to use:
https://
instead of:
http://
For example:
https://yourdomain.com
HTTPS helps encrypt information transferred between your visitors and your website.
It is especially important for:
Login pages
Contact forms
Customer accounts
Online stores
Payment-related pages
After enabling SSL, make sure your website redirects HTTP traffic to HTTPS.
Step 11: Create Your Business Email
Your hosting package may allow you to create professional email addresses using your domain.
For example:
A domain-based email address generally looks more professional than using a personal email address for business communication.
You can usually create email accounts from the hosting control panel.
Step 12: Test Your Website
Before promoting your website, test it carefully.
Check:
Home page
Navigation menu
Images
Contact forms
Mobile responsiveness
HTTPS
Email forms
Login pages
Links
Website speed
Also test your website from a mobile phone because many visitors may access it from mobile devices.
Step 13: Add Your Website to Google
Once your website is online, you can start preparing it for search engines.
Create and submit a sitemap where applicable.
You can also use Google Search Console to monitor how Google discovers and indexes your website.
Make sure important pages contain:
Clear titles
Useful content
Meta descriptions
Proper headings
Relevant keywords
Internal links
Avoid copying content from other websites.
Step 14: Keep Your Website Updated
Publishing your website is only the beginning.
You should continue maintaining it after launch.
Regular maintenance may include:
Updating WordPress
Updating plugins
Updating themes
Updating application software
Checking backups
Removing unused plugins
Monitoring website errors
Checking SSL status
Changing weak passwords
Keeping your website updated can reduce security and compatibility problems.
Step 15: Keep Your Own Backups
Even if your hosting provider offers backups, keep an independent copy of important website files and databases.
You can keep backups on:
Your computer
External storage
Cloud storage
Another backup server
For database-driven websites, remember that backing up only the website files may not be enough. You should also back up the database.
How to Host an HTML Website
If you already have an HTML website, the process is simple.
Purchase a domain and hosting plan.
Connect your domain to the hosting server.
Open File Manager.
Open the main web directory.
Upload your HTML, CSS, JavaScript, and image files.
Make sure
index.htmlexists.Enable SSL.
Visit your domain and test the website.
Your website should then be available online.
How to Host a PHP Website
For a PHP website:
Purchase compatible web hosting.
Upload your PHP files.
Select the required PHP version.
Create a database if needed.
Import your database.
Update your database configuration.
Configure your domain.
Enable SSL.
Test the application.
Make sure your hosting server supports the PHP version required by your application.
How to Host a Laravel Website
Laravel hosting requires a little more configuration than a basic PHP website.
You may need:
Compatible PHP version
Composer
MySQL or MariaDB
Required PHP extensions
Correct document root
Writable storage directories
.envconfiguration
A Laravel application's public web directory should normally point to its public directory.
Your .env file may require configuration such as:
APP_URL=https://yourdomain.com
DB_HOST=localhost
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_passwordAfter deployment, you may also need to run Laravel commands depending on your application and hosting environment.
For larger Laravel applications, a VPS may provide more flexibility.
Shared Hosting or VPS: Which One Should You Choose?
Choose shared hosting when:
You have a small or medium website
You have a WordPress website
You have a standard PHP website
You want a lower-cost hosting option
You do not need server root access
Choose VPS hosting when:
You need root access
You need custom server software
You need more CPU or RAM
You run larger applications
You need custom server configurations
You expect significant traffic
Starting with shared hosting and upgrading later is suitable for many websites.
Common Website Hosting Problems
Website Is Not Opening After Changing Nameservers
DNS changes are not always immediate.
Check that your nameservers or DNS records are correct and allow time for DNS changes to propagate.
Website Shows a Default Hosting Page
Your website files may not be inside the correct web directory.
Check your document root and confirm that index.html or index.php is present.
HTTPS Is Not Working
Check whether your SSL certificate has been installed and activated correctly.
Your domain must normally point to the hosting server before SSL can be issued successfully.
Database Connection Error
Verify:
Database name
Username
Password
Hostname
User permissions
A single incorrect database setting can prevent an application from connecting.
Images or CSS Are Not Loading
Check file paths and filename capitalization.
On some hosting environments:
Logo.png
and
logo.png
may be treated as different files.
Frequently Asked Questions
How much does it cost to host a website in Sri Lanka?
The cost depends on the hosting provider and resources included in the package.
Ceylon Web Servers shared hosting starts from Rs. 2,200 per year.
Do I need technical knowledge to host a website?
You do not need advanced server knowledge for a basic shared hosting website.
A hosting control panel can be used for most common tasks such as uploading files, creating email accounts, managing databases, and installing SSL.
Can I host a WordPress website in Sri Lanka?
Yes. WordPress can run on a compatible shared hosting account or VPS.
Can I host my own HTML website?
Yes. Upload your HTML, CSS, JavaScript, and image files to the main web directory of your hosting account.
Do I need a domain before buying hosting?
Not always.
You can purchase hosting first and connect a domain later, although you will normally need a domain before visitors can access your website using a normal website address.
Can I move my existing website to another hosting provider?
Yes.
Website migration usually involves transferring files, databases, emails where applicable, and then updating the domain's DNS records.
Host Your Website with Ceylon Web Servers
If you are ready to publish your website, Ceylon Web Servers provides hosting options for personal websites, businesses, developers, and online projects in Sri Lanka.
Available hosting options include:
Shared Hosting
Reseller Hosting
VPS Hosting
Shared Hosting starts from Rs. 2,200 per year.
For hosting assistance or more information:
Website: ceylonwebservers.com
Call / WhatsApp: 070 244 7722
Choose the hosting package that matches your website requirements, connect your domain, upload your website, enable SSL, and your website can be available online.