Step-by-Step Guide to Hosting WordPress on AWS Lightsail – 1
WordPress is one of the most popular CMS platforms for building websites, portfolios, blogs, and business applications. While traditional hosting platforms make deployment easy, cloud hosting platforms like AWS Lightsail provide more flexibility, scalability, and hands-on infrastructure control.
In this guide, we’ll walk through the complete process of hosting a WordPress website on AWS Lightsail — from launching the server to configuring DNS and enabling SSL.
Why Use AWS Lightsail for WordPress?
AWS Lightsail is a simplified cloud hosting service provided by Amazon Web Services. It combines virtual servers, networking, storage, and DNS management into an easy-to-use platform.
Benefits include:
- Simple WordPress deployment
- Fixed monthly pricing
- Easy scalability
- Linux server access
- Built-in networking features
- Static IP support
- DNS management
- Better cloud learning experience
Lightsail is ideal for beginners exploring AWS as well as developers who want more control over hosting environments.
Step 1: Create an AWS Lightsail Instance
The first step is launching a WordPress server.
Steps:
- Login to AWS Console
- Open AWS Lightsail
- Click Create Instance
- Select:
- Platform: Linux/Unix
- Blueprint: WordPress
- Choose an instance plan
- Give the instance a name
- Launch the instance
Once created, AWS will automatically provision a Linux server with WordPress pre-installed.
Step 2: Access Your WordPress Website
After deployment:
- AWS provides a public IP address
- Open the IP address in a browser
- The default WordPress website should load
You can also access the server terminal using:
- Browser-based SSH
- PuTTY
- Terminal using SSH keys
Step 3: Retrieve WordPress Admin Credentials
AWS stores the default WordPress admin password inside the server.
Use SSH and run:
cat bitnami_application_password
Or depending on the setup:
sudo cat /home/bitnami/bitnami_application_password
Then login to:
http://YOUR-IP/wp-admin
Step 4: Create and Attach a Static IP
By default, the server uses a temporary public IP.
A Static IP ensures your server IP does not change after rebooting or restarting the instance.
Steps:
- Open Lightsail Networking
- Click Create Static IP
- Attach it to your instance
This Static IP will later be connected to your domain name.
Step 5: Connect Your Domain Name
To use a custom domain:
Option 1 — Use Lightsail DNS
- Create a DNS zone in Lightsail
- Add domain records
- Update nameservers at your domain registrar
Option 2 — Use External DNS Provider
You can also manage DNS directly from providers like:
- Hostinger
- GoDaddy
- Namecheap
- Cloudflare
Step 6: Add DNS A Record
Create an A record pointing your domain to the server Static IP.
Example:
| Type | Name | Value |
|---|---|---|
| A | @ | YOUR_STATIC_IP |
Optional:
| Type | Name | Value |
|---|---|---|
| A | www | YOUR_STATIC_IP |
DNS propagation may take a few minutes to several hours.
Step 7: Configure Firewall Rules
Ensure the required ports are open inside AWS Lightsail.
Required Ports
| Service | Port |
|---|---|
| SSH | 22 |
| HTTP | 80 |
| HTTPS | 443 |
Without port 443, SSL websites will not load properly.
Step 8: Install SSL Certificate
SSL enables HTTPS and secures communication between users and the website.
AWS Lightsail WordPress instances commonly use:
- Apache
- Nginx
- Bitnami stack
A popular method is using Let’s Encrypt with Certbot.
Install Certbot
Example for Debian/Ubuntu:
sudo apt update
sudo apt install certbot python3-certbot-apache -y
Step 9: Generate SSL Certificate
Run:
sudo certbot --apache
The tool will:
- Validate domain ownership
- Configure Apache
- Install SSL automatically
During setup:
- Enter your domain
- Select HTTPS redirection
- Allow certificate deployment
Step 10: Verify HTTPS
Open:
https://yourdomain.com
You should now see:
- Secure padlock icon
- HTTPS enabled
- Valid SSL certificate
Step 11: Test SSL Using CLI
Useful SSL verification commands:
Check SSL certificate
openssl s_client -connect yourdomain.com:443
View certificate expiry
echo | openssl s_client -servername yourdomain.com -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -dates
Test automatic renewal
sudo certbot renew --dry-run
Step 12: Secure and Optimize WordPress
Recommended post-deployment tasks:
- Change default admin username
- Use strong passwords
- Install security plugins
- Enable backups
- Configure caching
- Optimize images
- Keep plugins updated
- Use CDN if required
Common Issues During Setup
DNS Not Resolving
Usually caused by:
- Incorrect nameservers
- Missing A record
- DNS propagation delay
SSL Validation Failed
Often caused by:
- Domain not pointing to server
- Port 80 or 443 blocked
- Firewall restrictions
Website Not Loading
Check:
- Apache/Nginx service
- Firewall settings
- Static IP attachment
- DNS records