77 Online Shopping Statistics for 2020

online shopping statistics header

Staying up to date with eCommerce and online shopping trends is essential for any online business in 2020. With so many shoppers scouring the internet for the best deals to save them time and money, you need to make sure your website offers the best user experience possible.

So, what trends are the most crucial for your business? Mobile continues to be an increasingly important factor, and omnichannel shopping is becoming more prevalent as well. Other areas of note are video and image search, voice search and influencer marketing, which is said to be one of the fastest-growing customer acquisition methods on the internet.

It might sound a bit overwhelming, but that’s because baby boomers, millennials and Gen Zers alike all engage with online shopping differently. To be sure you’re not missing out on any lucrative opportunities, staying up to date with the latest eCommerce dialogue is a must.

We’ve identified 77 of the most important eCommerce and online shopping statistics you need to know to be successful. They are listed under the ten major categories below:

  1. Conversion Rate Optimization Stats
  2. Mobile Commerce Stats
  3. Shopping Cart Abandonment Stats
  4. Email and Retargeting Campaign Stats
  5. Video Content Stats
  6. Social Media Stats
  7. Voice Search Stats
  8. Local Search and Omnichannel Stats
  9. Customer Relationship Management Stats
  10. Influencer Marketing Stats

1. Conversion Rate Optimization (CRO) Stats

Searchers are savvier than ever and can spot a site that isn’t up to date with its design and user experience. To give the user the best experience possible, webmasters and digital teams are constantly testing and tweaking their sites to ensure all pages are optimized.

  • 60% of digital marketers plan on implementing customer journey analysis to improve conversion rates this year (source)
  • Videos and landing pages can improve CRO by as much as 86% (source)
  • Page-load speed delayed by even 1 second can reduce conversions by 7% (source)
  • Companies with 40+ landing pages generate 12x more leads than those with only one to five landing pages (source)
  • Building and testing landing pages is one of the top five problems for digital marketers (source)
  • 48% of marketers build new landing pages for each campaign (source)
    Only 52% of companies that use landing pages test them to improve conversions (source)

conversion rate optimization stats

Key Takeaways

A fundamental understanding of how your customers navigate your funnel is essential to increasing conversions. To implement such analysis effectively, you need to learn how your customers interact with your website and determine what you can do to make their experience more seamless and enjoyable.

Try running heatmap testing to see where users are spending most of their time on your pages. You can also run A/B tests to see if certain copy or design changes drive more conversions than others.

2. Mobile Commerce Stats

Mobile users are on the rise. As Google continues to unfurl and improve Mobile-First indexing, online companies should always keep in mind their mobile experience when creating new web pages. Pages should look identical and flow seamlessly on mobile devices.

  • Mobile eCommerce sales are projected to make up to 63.5% of total eCommerce sales this year (source)
  • Global mobile eCommerce revenue is expected to reach up to $669 billion this year (source)
  • Mobile sales on Cyber Monday in 2017 broke $2 billion, making it the largest online shopping day in history (source)
  • Eight in 10 Americans shop online; 51% of them have purchased something with their smartphone (source)
  • By 2020, more than 3.3 billion users will have virtual assistants on their devices (source)
  • Mobile wallets are expected to surpass both credit and debit purchases by 2020 (source)
  • In-store mobile payments are expected to reach $503 billion by 2020 (source)
  • 40% of mobile users leave pages that take longer than three seconds to load (source)

mobile commerce statistics

Key Takeaways

All of your web pages should be optimized for mobile. A poor mobile experience will hurt your ranking ability and could cost you sales. Users are prone to bouncing off of sites with slow loading times and poorly designed mobile pages. There are several guidelines outlined by Google about how you should design a site for mobile users. In the end, your goal should be to make things easier for the user.

To improve your mobile experience, convert key product and sales pages to Accelerated Mobile Pages (AMP) and make sure CTAs are prominently placed so that they are easy to see and press while scrolling.

3. Shopping Cart Abandonment Stats

Shopping cart abandonment has always been an issue. As users continue to shift to online shopping, companies have tried various techniques for keeping users from leaving a full cart without purchasing.

  • 60% of cart abandonments are due to extra costs, like taxes, shipping, and fees (source)
  • 28% of US shoppers abandon their orders due to a complicated or drawn-out checkout process (source)
  • The average eCommerce site can increase conversion rates by 35.26% by improving their checkout design (source)
  • 58.6% of shoppers abandon carts while browsing or because they are unready to buy (source)
  • 35% of transactions are lost when websites require users to create accounts before purchasing (source)
  • $260 billion is recoverable through improved checkout processes (source)

shopping cart abandonment statistics

Key Takeaways

Shopping cart abandonment is bound to happen. Many users add items to the cart with no intention to buy, while others may be comparing your prices to other vendors. What you should be worried about is how many of those abandonment cases are due to a poor checkout experience.

Users generally don’t like creating accounts before purchasing, and many will abandon their cart once shipping costs and taxes are factored in. To avoid losing sales, offer several types of payment options and make sure there as few steps as possible. Another tactic is an email reminder when users leave things in their cart to remind them to buy.

4. Email and Retargeting Campaign Stats

By 2020, total display and ad spending are expected to surpass search by 28 percent. Why the sudden surge? Marketers are just now realizing the potential in remarketing: Conversions increase the more a user has seen an ad.

  • Online shoppers are 70% more likely to convert when retargeted with display ads (source)
  • 54% of shoppers say they would purchase abandoned items if those items were offered at a lower price later (source)
  • 72% of customers abandon their shopping cart; only 8% of those return to complete checkout (source)
  • But 26% of online shoppers will complete the checkout process after seeing a retargeted ad (source)
  • Three out of four users notice retargeting ads (source)
  • 24% of companies with over 1,000 employees spend 50% or more of their marketing budget on retargeting (source)
  • 72% of millennial shoppers say they don’t mind retargeting (source)
  • 55% of shoppers claim that testimonials and reviews influence their buying decision (source)

retargeting campaigns statistics

Key Takeaways

Retargeted display ads and email campaigns are some of the best methods to rekindling relationships with former customers. One proven tactic is to offer discounts in your retargeting emails, making sure to include the promotion in your subject line.

It’s also a best practice to retarget current customers. This keeps them in the loop about promotions and prevents them from switching to a competitor in the future.

5. Video Content Stats

Video content is eye-catching and can showcase your products in real-time. Users prefer this experience, as it allows them to visualize owning the product before purchasing it. Users also like to compare products online, so having multiple angles of a product, or a demo video of how it functions, is preferred.

  • 4x as many consumers prefer to view a video about a product than reading about it (source)
  • Product videos can increase conversion rates by as much as 144% (source)
  • Videos can increase organic traffic by up to 157% (source)
  • 43% of internet users want to see more video content (source)
  • Four out of 5 consumers find demo videos helpful when making a purchase (source)
  • 43% of viewers will interact with a brand on social media over video content (source)
  • Roughly 50% of online shoppers search for videos related to a product before buying it in-store (source)
  • 92% of shoppers say visuals influence their buying decision the most (source)

video content statistics

Key Takeaways

Video is a must for increasing brand awareness and conversions. Visual content tends to perform the best in terms of shares, and it also has the potential to increase referral traffic to your site when shared on social media platforms.

For the best results, invest in producing high-quality video content, post it regularly both on your website and social channels and track how your audience reacts to your content.

6. Social Media Stats

Social media is a great way to increase referral traffic and conversions for brands that have learned to use it properly. The key is to determine which social platforms work best for your industry. Brands that thrive off of visual content do well on Pinterest or Instagram, for example.

  • Visual content is 40x more likely to get shared on social media than other forms of content (source)
  • Facebook influenced 52% of consumers’ online and offline purchases in 2015 (source)
  • 85% of all eCommerce purchases from social media come from Facebook (source)
  • Facebook has a conversion rate of 1.85%, the highest out of all social media platforms (source)
  • Stores with a social media presence have on average 32% more sales than stores without one (source)
  • 48% of Americans have engaged with a company or brand on social media (source)
  • 84% of US online shoppers review at least one social media site before making a purchase (source)
  • The average order value of customers referred from Instagram is $65 (source)
  • The average order value of customers referred from Facebook is $55 (source)

social media statistics

Key Takeaways

Social media is a great way to build brand awareness. For the best results, analyze what competitors are doing to see which channels garner the most responses from your target audience. Once you’ve figured out your areas of focus, develop a content calendar so you’re regularly updating your social media accounts.

7. Voice Search Stats

Voice search is projected to become the preferred search method in the coming years. Though far from perfect, users are growing more accustomed to voice search because of the prevalence of smart speaker devices in homes, voice search options on smartphones and machine learning, which allows smart devices to better anticipate searcher intent over time.

  • Voice and image search are projected to make up 50% of all searches by 2020 (source)
  • 40% of millennials have used voice search before making an online purchase (source)
  • 76% of smart speaker users perform local searches on a weekly basis (source)
  • Of those users, 53% search every day (source)
  • 58% of consumers have performed voice searches to find local businesses information over the last year (source)
  • 46% of voice searchers search for local businesses daily (source)
  • 46% of consumers would like to hear businesses prices over voice search (source)
  • 27% of searchers visit a business’ website after finding it via voice search (source)

voice search statistics

Key Takeaways

Voice search is becoming more popular as voice-first devices and voice search for smartphones become more sophisticated. Siri alone handles 1 billion voice search queries a week, and a large portion (22 percent) of those searches are local.

To optimize for voice search, you need to think of “conversational” long-tail keywords that pertain to your business and have a section of your FAQ page dedicated to answering those queries.

8. Local Search and Omnichannel Stats

Local search and omnichannel shopping go hand in hand. Many shoppers are beginning their purchasing journey online to research a product before buying it in-person at a brick-and-mortar location.

  • 50% of consumers who search for a local business on a smartphone visit the store within 24 hours (source)
  • 18% of local searches lead to sales (source)
  • Four out of 5 people use search engines to perform local searches (source)
  • 73% of smartphone user participants in a Google survey said that directions were important in local PPC ads (source)
  • 70% of computer and tablet users in the same Google survey said it was important that ads be customized to their immediate surroundings (source)
  • 98% of Americans switch between devices multiple times a day (source)
  • 77% of companies with a strong omnichannel experience store customer data across multiple channels (source)
  • Companies with strong omnichannel engagement retain 89% of their customers (source)

local search statistics

Key Takeaways

As a local business, it’s more important than ever to have an online presence. Users often compare products online before heading in-store to purchase them. Still, other users might prefer to shop local and purchase online, while others solely prefer the in-store experience.

Whatever the case, the advantage of having both an in-store and online clientele is that your business can cater to baby boomers, millennials and Gen Zers alike.

9. Customer Relationship Management (CRM) Stats

The CRM industry is worth $36 billion. CRM software makes it easier for companies to stay up to date on customer relationships in every area of the purchasing funnel. With such a comprehensive resource at hand, it’s difficult for customers to fall between the cracks.

  • 79% of leads fail to convert without CRM software (source)
  • Social CRM systems can improve retention by 26% (source)
  • Conversion rates can increase by 300% with a CRM in place (source)
  • 74% of businesses using a CRM report better customer relationships (source)
  • The average ROI on CRMs is $5 to every $1 invested (source)
  • CRM software can improve sales by as much as 29% (source)
  • 22% of salespeople have no idea what a CRM is (source)

CRM Statistics

Key Takeaways

CRM software provides the best means to centralize all of your interactions with previous, current and potential customers in one place. By allowing you to monitor each step and phase of the customer journey on an individual basis, you significantly increase your chances of capturing and converting leads while improving retention.

10. Influencer Marketing Stats

With the emergence and maturation of real-time platforms like Snapchat, Instagram and Twitter over the last few years, influencer marketing has become a truly effective way to sell a product. Users have begun to place more stock in Instagram and Youtube influencers in particular, compared to celebrities, since these internet stars are more relatable.

  • 39% of marketers plan on increasing their influencer marketing budget in 2018 (source)
  • A Twitter study reports that 40% of its user base say they’ve purchased something as a direct result of a Tweet from an influencer (source)
  • 80% of influencers use Instagram to post original content (source)
  • 28% of marketing managers ranked influencer marketing as the fastest-growing customer acquisition method on the web (source)
  • The average earned media value for influencer marketing is $7.65 to every $1 spent (source)
  • 37% of marketers in a 2017 Influencer Hub Study are allocating budgets for influencer marketing (source)
  • Out of that survey, 67% of marketers plan on increasing their influencer marketing budget (source)

influencer marketing statistics

Key Takeaways

The main benefit of influencer marketing is that ROI is easy to trace. As seen in the stats above, many users purchase products as a direct result of a favorable review from an acclaimed influencer. These have sometimes backfired for brands, so always be careful to choose an influencer that can follow direction from your brand.

Summary

The future of shopping is online. Shoppers of all ages have higher expectations than they used to, and the only way to cater to different age groups and preferences is to ensure your site is convenient and trustworthy. Give your users the best experience possible and you’ll then reap the benefits later.

online shopping statistics button

 

The post 77 Online Shopping Statistics for 2020 appeared first on hostingfacts.com.

-

How to Host a Website (Step-by-Step)

How to create a server

To host a website on a server, you’ll need to get your hands dirty and set up the whole environment by yourself. Below, you’ll find a generalized example of how to get things done using a virtual private server running Ubuntu 18.04

In short, you’ll need to:

  • Perform the initial server setup
  • Set up a DNS zone and point your domain
  • Install a software stack
  • Create a virtual host
  • Get your website up and running

P.S. If you don’t want to go through this complicated steps, consider getting a web hosting.

1. The First Server Setup Steps

If you decide to rent a dedicated server or a VPS, you’ll first need to lay a solid foundation. This involves accessing your server through a terminal or an SSH client and making security tweaks and updates.

Connect to Your Server

Start by connecting to your server. The following command will do the trick:

ssh root@your_server_IP -port

When connecting for the first time, you may be prompted to add your server IP to the list of known hosts. Type in yes to proceed and you’ll then be prompted to enter the root password.

adding server IP to known hosts

Here’s an example of what you should see on your screen if everything went right.

initial Ubuntu SSH login screen

Get the Latest Updates

Run the following commands to get the latest updates for your Ubuntu 18.04 server:

sudo apt update
sudo apt upgrade

When running the second command, you’ll see a confirmation screen. Type in Y to proceed.

confirming server updates Ubuntu

Create a New User

Next, you’ll need to add a new user, as using the root one for everyday tasks is not recommended. Let’s call it webmaster. To begin the user creation, execute:

adduser webmaster

creating a new user Ubuntu

Once you create a password, you’ll be prompted to enter the general details (which you can leave blank). Then, type in Y to confirm the new user creation.

By default, the new user won’t have enough privileges to do everything you need, hence you’ll need to add them manually. Here’s how you do it:

usermod -aG sudo webmaster

That’s it! Your new administrative user is ready. To start using it instead of root, execute:

su – webmaster

changing system user

Set Up Public Key Authentication (Optional)

Using a password to authenticate leaves you vulnerable to brute-force attempts and puts your server in a moderate risk (especially if you’re lazy to set up a unique and strong password).

A great way to improve server integrity is to use SSH keys instead of a regular password. The steps should be identical regardless of which Linux distribution you’re running. To begin log out of your server and execute the following command on your local computer to create a new public key:

ssh-keygen

You’ll be asked to enter an additional passphrase and the location of where to save the public key. By default, it saves everything to /Users/Your_User/.ssh directory (which you can keep unless you have other plans in mind).

running SSH keygen

As soon as it’s finished, copy over the SSH key to your server by using:

ssh-copy-id webmaster@your_server_IP

You may also do the same for your root user just in case:

ssh-copy-id root@your_server_IP

moving SSH key to remote server

Finally, you’ll need to login to your server again. Only this time, you’ll be using the SSH key and its passphrase to authenticate. If your password is guessed by someone, they will be unable to log in, as the public key is required to make a successful connection.

logging into server with SSH key

Disable Password Authentication (Optional)

Since you’re now able to access your server with the newly generated SSH key, it’s advisable to disable the regular password authentication. To do so, we can use the nano text editor:

sudo nano /etc/ssh/sshd_config

Look for a line that says #PasswordAuthentication yes, delete the # and change the yes to a no. The final result should look like:

disabling password authentication in sshd config

To save these changes and exit the nano editor, press CTRL+X, type in Y and press Enter. And finally, apply everything by reloading the sshd service:

sudo systemctl reload sshd

And that’s it! You’ll now use a public key to authenticate instead of a password, which is considered a more secure way to access and manage a server.

Set Up a Firewall

Last, but not least, it’s advisable to use a firewall to protect yourself from the dangers lurking on the web. Uncomplicated Firewall is one of the best tools for the job. To set it up, execute:

sudo apt-get install ufw

When installed, the firewall will not work unless turned on manually. You can enable it by using:

sudo ufw enable

enabling ufw Ubuntu

To check if it’s up and running, execute:

sudo ufw status verbose

 

2. Set Up a DNS Zone

The next challenge will be creating a DNS zone, which acts as the binding material between a domain name and a server. We can break it down into two smaller steps:

  1. Setting up a DNS zone within your server
  2. Creating custom nameservers at your domain registrar

Create a New DNS Zone

To make a new DNS zone, we’ll be using a tool called bind9. In the end, this is the service that allows us to load a website through a domain name instead of an IP address.

To install Bind9 on your Ubuntu 18.04 server, execute:

sudo apt-get install bind9

Once installed, all the files will be available in the /etc/bind directory. Let’s navigate to it first:

cd /etc/bind

To keep everything neat and organized, we’ll create a separate directory for our DNS zones:

sudo mkdir -p zones

Let’s create a new DNS zone file for our domain. We’ll be using domain-example.com for demonstration purposes (you should replace it with your actual domain name).

sudo nano zones/domain-example.com

DNS zone snippet example:

;
; BIND data file for domain-example.com
;
$TTL    3h
@       IN      SOA     ns1.domain-example.com. admin.domain-example.com. (
                          1        ; Serial
                          3h       ; Refresh after 3 hours
                          1h       ; Retry after 1 hour
                          1w       ; Expire after 1 week
                          1h )     ; Negative caching TTL of 1 day
;
@       IN      NS      ns1.domain-example.com.
@       IN      NS      ns2.domain-example.com.


domain-example.com.     IN      A       YOUR_SERVER_IP
ns1                     IN      A       YOUR_SERVER_IP
ns2                     IN      A       YOUR_SERVER_IP
www                     IN      CNAME   domain-example.com.
mail                    IN      A       YOUR_SERVER_IP
ftp                     IN      CNAME   domain-example.com.
domain-example.com.     IN      MX      10      domain-example.com.

Make sure to replace all instances of your Your_Server_IP and domain-example.com with the actual values. Save the zone file by pressing CTRL+X and then typing Y to confirm the changes.

Next up, we’ll need to edit the local configuration and specify the location of our newly created DNS zone. This ensures that the server knows which zone file belongs to which domain name.

sudo nano named.conf.local

Paste down the following lines at the bottom of the file while replacing domain-example.com with your actual website address.

zone "domain-example.com" {
       type master;
       file "/etc/bind/zones/domain-example.com";
};

Press CTRL+X and input Y to save your changes and exit the nano editor.

You can also test out whether everything was added and configured correctly by executing the following command:

sudo named-checkzone domain-example.com /etc/bind/zones/domain-example.com

verifying dns zone

Lastly, run these two commands to restart your server’s DNS service and to make sure it’s running:

sudo /etc/init.d/bind9 restart
sudo /etc/init.d/bind9 start

At this point, the DNS zone is ready from your server side. To finalize it, you’ll need to create custom nameservers entries within your domain registrar.

Create Custom Nameservers For Your Domain

Since we specified two nameservers (ns1.domain-example.com and ns2.domain-example.com) in our DNS zone example, we’ll need to create these entries at the domain registrar and use them.

Here’s how the entries should look like:

Custom Nameserver Points to
ns1.domain-example.com Your_Server_IP
ns2.domain-example.com Your_Server_IP

child nameserver creation

Once created, you’ll need to point your domain to these new nameservers.

3. Install LAMP Stack

LAMP is one of the most used software stacks of the web. It stands short for Linux, Apache HTTP Server, MySQL/MariaDB, and PHP. Before hosting a site, you’ll need to make sure all these ingredients are available at your server. Here’s how the process of setting them up would look using Ubuntu 18.04:

Apache

Apache HTTP Server may already be included in the default packages that come with your server. If not, then execute:

sudo apt-get install apache2

install Apache

Since there’s a firewall, we need to make sure these ports are open as Apache won’t work properly otherwise. Here’s what you should allow through the firewall:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Then, restart it to make sure the changes are applied:

sudo ufw reload

At this point, here’s what you should see by visiting the IP address of your server through a browser:

default Apache2 page

PHP

To get the latest PHP version with a few extra modules that WordPress needs, execute:

sudo apt-get install php php-common php-mysql php-gd php-cli

confirm PHP installation

You can check which PHP version was installed on your server by typing:

php -v

check PHP version

MySQL/MariaDB

MariaDB and MySQL are two of the top choices for your database server in Linux. For this example, we’ll use MariaDB. To install it on your server, execute:

sudo apt-get install mariadb-server mariadb-client

install Mariadb

Once done, you’ll need to use an additional script that comes with the package. It will establish the basic security measures for your database server. Start it by typing:

sudo mysql_secure_installation

At the very first step, you’ll be asked to provide the root MySQL password. Press the Enter button to continue as it’s not created yet. Then follow the rest of the instructions that pop up in the command line interface.

Mariadb secure installation

Finally, you can check if my database server is operational by running:

sudo systemctl status mysql

4 Create a Virtual Host

The next task will be creating a dedicated directory for your website files. Start by changing your working directory:

cd /var/www/html

Use this command to create a folder for your domain and an additional one within in:

sudo mkdir -p domain-example.com/public_html

Then, make the webmaster user we created previously the owner by using:

sudo chown -R webmaster:webmaster domain-example.com/public_html

You’ll also need to make sure that read permissions are applied to the Apache root directory. In this case:

sudo chmod -R 755 /var/www/html/

At this point, Apache gets all the settings from the 000-default.conf file. We’ll need to copy the contents of this file and create a separate one for our domain name. The easiest way to copy a template of the virtual host configuration is by using the following command:

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/domain-example.com.conf

Essentially, this makes a copy of the file under a different name in the same directory. This is the file that tells your Apache web server the location of a domain’s root directory, error log, and other important paths. To change its content, we’ll use nano:

sudo nano /etc/apache2/sites-available/domain-example.com.conf

 

Apache config example:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        ServerAdmin admin@domain-example.com
        DocumentRoot /var/www/html/domain-example.com/public_html
        ServerName domain-example.com
        ServerAlias www.domain-example.com
        
        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        
        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

Make sure to replace all instances of domain-example.com with your actual domain name. To save the file, press CTRL+X and confirm by typing Y. The final result should look like:

adding domain config to Apache

At this point, you’ll need to turn off the default virtual host configuration file and use the newly created one. This command will disable it:

sudo a2dissite 000-default.conf

Then, add the recently created configuration file as shown below:

sudo a2ensite domain-example.com.conf

Lastly, you’ll need to restart Apache for the changes to apply. You can do that by running:

sudo systemctl reload apache2

You successfully installed LAMP on your server. Since your domain is already pointed to the server, you may need to wait a few hours for the DNS to fully propagate. Then you should see a similar screen when visiting your domain through the browser.

domain root directory content

5. Set Up WordPress (or Upload a Website)

Since the initial server setup is finally complete, it’s time to host a website on it. In this section, we’ll show you a generalized example of how to get a WordPress site up and running.

Create a New MySQL Database and User

Start by accessing the MySQL interface through the terminal:

sudo mysql

>Use the following syntax to make a new database:

CREATE DATABASE wpdatabase;

Then, create a new user and specify the password:

CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'SuperSecurePassword123';

Next, assign administrative privileges to your newly created user with:

GRANT ALL PRIVILEGES ON wpdatabase.* TO 'wpuser'@'localhost';

That’s it! Your MySQL user and database are ready for action. To turn off the interface, type in:

exit

Move WordPress Files to Your Server

Last, but not least, we have to get the actual website files uploaded to the root directory of your domain. There are two approaches that we’ll describe step-by-step:

  • Using the wget command to get the latest WordPress version
  • Configuring an FTP client (such as FileZilla)

Method 1: Using the Command Line Tools

The first way is to use a command called wget. To use it on your server, you’ll have to install it:

sudo apt-get install wget

Then, change your working directory to the root folder of your domain name:

cd /var/www/html/domain-example.com/public_html

Use the wget command to download the latest version of WordPress from the web:

wget https://www.wordpress.org/latest.zip

Then, extract all the contents of the archive by using:

unzip latest.zip

By default, all the files will appear in a new directory called wordpress (which may result in your website working via domain-example.com/wordpress). For everything to work correctly, we’ll need to move all the files out of that directory to the one above. Here’s how to do it:

cd wordpress

The following command will move all files from the current directory to your specified location:

sudo mv * /var/www/html/domain-example.com/public_html/

Before starting the installation, you’ll need to prepare your wp-config.php file. Since only a sample one is provided. Start by renaming it:

sudo mv wp-config-sample.php wp-config.php

Then, edit the file using nano and add the MySQL database configuration details.

sudo nano wp-config.php

Make sure to update the MySQL User, Database, and Host sections with the values that you created previously.

editing WP config

Lastly, visit your domain name in the browser and you’ll see the initial WordPress setup screen.

initial WordPress setup

Once you finish it, you can install a migration plugin such as All-in-One WP Migration to import an existing WordPress website.

Method 2: Using an FTP Client

Alternatively, you can use an FTP client such as FileZilla. In case you configured an SSH key and disabled password authentication, you’ll need to use it to log in instead of the regular username and password combination. To configure the SFTP connection:

  1. Go to FileZilla Site Manager and add a New Site.
  2. Set the protocol to SFTP – SSH File Transfer Protocol.
  3. Enter your server IP in the Host field and set the port to 22.
  4. Set the login type to Key file.
  5. Specify the path to your SSH key (e.g. /Users/Name/.ssh/id_rsa).
  6. FileZilla will convert it into a .ppk file, which you can then use to make a connection.

converting SSH key

The final configuration should look something like this:

FileZilla sftp configuration

Now, you’ll be able to access your server via FTP and upload any files directly from your computer.

FileZilla sftp connection

Congratulations! You’ve learned how to host a website on a virtual private server running Ubuntu 18.04. Everything from the initial server setup to preparing the software stack has been covered. All that’s left is to grab a server and get your hands dirty!

This article was published with the help of Hostinger.com.

The post How to Host a Website (Step-by-Step) appeared first on HostingFacts.com.

-