Free [$100 Value] WordPress Cloud Hosting for 12 Months by Amazon AWS — For New or Existing Sites

Dani Shulman
4 min readOct 14, 2019

--

Like the post when your free WordPress site is up and running!

I’m no affiliated with Amazon AWS and don’t earn any commission form this. I’m simply sharing a way to get 12 months of free services to host a WordPress website. Amazon’s free tier cloud server (t2.micro) regularly costs $100/year and includes 1 vCPU and 1 gig of RAM, 30GB of storage, plenty for most new or existing sites.

Signup for a free AWS account

Signup and login to AWS with your info and a credit card to get one year of free services which include WordPress hosting, you will only be charged a nominal $1 to verify payment method.

Register a new domain name on AWS Route53

This step is not required if you already have a domain name. For those who need a new domain, head over to the Route53 AWS service to register a new one.

Launch WordPress Ready Server

Search and select the Region closest to your clients, then from the EC2 AWS service, and startup the WordPress Certified by Bitnami and Automatic instance (Free tier eligible)
Learn more about the Bitnami WordPress stack on AWS Marketplace

Login to WordPress Admin Panel

Once the instance is running, get the WordPress admin password by going to Actions > Instance Settings > Get System Log

Look for text similar to the following

#########################################################################
[ 17.218212] bitnami[1150]: # #
[ 17.251587] bitnami[1150]: # Setting Bitnami application password to 'PASSWORD HERE' #
[ 17.267773] bitnami[1150]: # (the default application username is 'user') #
[ 17.279058] bitnami[1150]: # #
[ 17.290154] bitnami[1150]: #########################################################################

In the instance description look for IPv4 Public IP, try it in your browser and you will see the WordPress blog installed.

Like the post when your free WordPress site is up and running!

You can start editing the Wordpress blog from:
http://IPv4-Public-IP/wp-admin
Use the username and password you got from log.

Configure a domain name

Open Route53 and select your domain and Create Hosted Zone

Like the post when your free WordPress site is up and running!

leave the Name empty or enter www. In value enter the Instance’s IPv4 Public IP.

If should create a CNAME record to redirect the non-www to www, or the opposite. This way there is just one official domain to the site.

Migrate your existing WordPress site to AWS

For those who have WordPress already running elsewhere (dev or prod), let’s move it over now. The easier way to do this step is with the Duplicator plugin, if you are comfortable to work in command line you can also follow the steps below.

We will be using SSH to move files and the database dump.

  1. SSH to your source server where your current WordPress is running, and find the root folder of WordPress files. Check your wp-config.php file for database name, user and password. Then run the command:
    mysqldump -u root -p DB-NAME > DB-NAME-$(date +%F).sql
    This will result in a dump of your database name with today’s date.
  2. Find the path to the destination folder. You can first transfer it to your machine or straight to the server. Archiving the files helps transfer to go faster scp -r user@10.10.10.10:~/htdocs/ ~/target/
  3. Upload the archive you made to the new Bitnami target server with scp -i key.pem ~/Archive.zip bitnami@yourdomain.com:~/apps/wordpress/htdocs
  4. Save the SQL login info or copy wp-config to have a copy: cp wp-config.php wp-config-original.php
  5. To overwrite the WordPress files which came with Bitnami with your source files. In SSH from ~/apps/wordpress/htdocs run unzip Archive.zip scroll up the logs to see if any files had any issues to be unzipped, if that happens it’s due to permissions. You can fix for example with sudo chown bitnami:daemon folder-name -R. This usually is the case on the uploads folder since it’s configured to upload from daemon running the PHP.
  6. Create a new database mysql -u root -p, enter the same password from the Bitnami log before, except now use root for username. Then do CREATE DATABASE your-new-table-name; Exit mysql and run the command mysql -u root -p your-new-table-name < your-new-table-name-DATE.sql
  7. Now edit wp-config.php with nano or vim, and replace if needed db name, username (root), password (from log).
  8. If you didn’t change domain name, it should all be good. But if you developed site on another URL and now you need to change domain there are some sql queries to run and update the domain.
    UPDATE wp_options SET option_value = replace(option_value, ’old-domain.com’ , ’new-domain’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
    UPDATE wp_posts SET guid = replace(guid, ‘old-domain.com’,’
    new-domain’);
    UPDATE wp_posts SET post_content = replace(post_content, ‘old-domain.com’,’
    new-domain’);
    UPDATE wp_postmeta SET meta_value = replace(meta_value,‘old-domain.com’,’
    new-domain’);
  9. Delete your Archive.zip and mysql dump

At this point it should be working well. If you have any questions feel free to message me dani.shulman@iqdev.ca

--

--