Technoracle
    Facebook Twitter Instagram
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    Facebook Twitter Instagram Pinterest Vimeo
    TechnoracleTechnoracle
    • Tutorials
      • Amazon Cloud
      • Google Cloud
    • How To
    • Blog
    • About
    Subscribe
    Technoracle
    Home»How To»How to Install WordPress on AWS EC2 in 10min
    How To

    How to Install WordPress on AWS EC2 in 10min

    Rajesh ShivamBy Rajesh ShivamMarch 22, 2022Updated:March 22, 2022No Comments4 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Install WordPress on AWS EC2
    Share
    Facebook Twitter LinkedIn Pinterest Email
    Install WordPress on AWS EC2

    If you are starting up a blog or any other web portal you need reliable web hosting. In this article, I will show you how to install WordPress on AWS EC2 cloud server. Follow this step-by-step article, you can easily set up your WordPress blog on AWS(Amazon Web Services) in 10 minutes.

    Page Contents

    • How to Install WordPress on AWS EC2
        • Create EC2 Instance
        • Instance type choose, server login key creation
        • How to SSH to the Server Console
        • LAMP setup on the server
        • Download WordPress files and file permissions
        • Configure wordpress files to install
        • Complete installation of wordpress on AWS EC2
      • Conclusion

    How to Install WordPress on AWS EC2

    I am assuming you already subscribed for AWS. To install wordpress, you have to launch an EC2 instance.

    Create EC2 Instance

    After login into the AWS console first, you have to launch an instance. You can launch a free tier instance from the EC2 dashboard which is free for 12 months*. Firstly select WordPress AMI from AWS Marketplace, provided by bitnami, or go for manual installation by following steps.

    *AWS Free Tier for Amazon EC2 provides you with 750 hours usage of Linux, More info

    Install WordPress on AWS EC2
    ec2 instance dashboard

    Instance type choose, server login key creation

    As a simple WordPress blog, the t2.micro type instance is good enough, when the site has less traffic and the instance is free for 750 hours. If you are looking for a highly available WordPress setup on AWS, read here. Choose the Instance type below.

    AWS Instance Type Choose.

    Configure Instance Details: You can skip this part for now.

    Add Storage: Default 8 GB storage is fine for simple wordpress blog.

    Add Tag: Add meaningful name for tag to discover.

    Security Group: AWS always recommends creating a separate security group, however, you can just add some inbound rules for now.

    Install WordPress on AWS EC2

    Review Instance Launch: Just select launch and select keypair, you will need this keypair for connecting your instance, make sure you saved it into a safe place.

    Install WordPress on AWS EC2
    Keypair create

    After downloading the instance key pair, you have to change the file permission to read by the server.

    chmod 400 technoServer.pem

    How to SSH to the Server Console

    So your instance is created, SSH to the instance using the key, you created during instance launch. For the instance details, select the check box of the instance.

    Install WordPress on AWS EC2
    Instance Dashboard

    For SSH, you need following-

    1. Public IPv4 address or Public DNS.
    2. Instance SSH Key
    3. User name.

    How to find user name of instance?
    Go to the connect in the instance dashboard.

    Install WordPress on AWS EC2

    You will find username, public IP, Instance ID, etc.

    SSH command:

    ssh -i KeyPair.pem [email protected]

    LAMP setup on the server

    After login into the server console, you will need to install the LAMP server, I already explain the steps to install the LAMP server here. Follow the article for LAMP installation.

    Download WordPress files and file permissions

    Now, download WordPress files from the official site. Run the below commands on the server console to download the latest WordPress version and configure it to document root.

    $ cd /tmp/
    $ /tmp$
    $ curl -O https://wordpress.org/latest.tar.gz
    $ tar xzvf latest.tar.gz

    Now copy over the sample configuration file to the filename that WordPress reads.

    $ cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php

    Copy the entire contents of the directory into our document root. We are using a dot at the end of our source directory to indicate that everything within the directory should be copied.

    $ sudo cp -a /tmp/wordpress/. /var/www/html

    Now you have to change some permissions of the files and directory for wordpress installation.

    $ sudo chown -R www-data:www-data /var/www/html
    $ sudo find /var/www/html/ -type d -exec chmod 750 {} \;
    $ sudo find /var/www/html/ -type f -exec chmod 640 {} \;

    Configure wordpress files to install

    Now setting up the WordPress configuration file

    File Name: /var/www/html/wp-config.php
    --------------------------------------
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'Database Name' );
    
    /** MySQL database username */
    define( 'DB_USER', 'Database User' );
    
    /** MySQL database password */
    define( 'DB_PASSWORD', 'Database Password' );
    
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );
    
    /** Database Charset to use in creating database tables. */
    define( 'DB_CHARSET', 'utf8' );
    
    /** The Database Collate type. Don't change this if in doubt. */
    define( 'DB_COLLATE', '' );
    
    
    . . .
    
    define('FS_METHOD', 'direct');

    Read here, how to create database for wordpress installation. After the database setup done, proceed for the installation via server IP or domain name.

    Complete installation of wordpress on AWS EC2

    In your web browser, navigate to your server’s domain name or public IP address

    https://server_domain_name_or_public_IP

    Now, follow the steps on the browser, and you are done.

    Conclusion

    In this article I have explained the steps to install WordPress on AWS EC2 instance. If you liked the article please share or if you have any questions, comment below to ask any question.

    wordpress install on ubuntu wordpress tips
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleQuick way to Install Anydesk on Ubuntu 22.04 / 20.04 Easily
    Next Article How to Install Tig on Ubuntu 20.04 Easily
    Rajesh Shivam

    Hello, everyone, I am Rajesh Shivam, I am a full-time freelancer with more than seven years plus experience in different freelancing platforms, in this blog, I am going to provide complete freelancing tips and tricks.

    Related Posts

    How To

    How to Install Microsoft Teams on Ubuntu 22.04 Easily

    February 22, 2023
    Read More
    How To

    What is Elastic IP and Its Pricing in AWS

    February 22, 2023
    Read More
    How To

    How to Convert PEM to PPK file [Step by Step Guide]

    February 22, 2023
    Read More
    Add A Comment

    Leave A Reply Cancel Reply

    Facebook Twitter Instagram Pinterest
    © 2023 Technoracle

    Type above and press Enter to search. Press Esc to cancel.

    Go to mobile version