Atlantic.Net Blog

How to Install Gatsby on Oracle Linux 8

Hitesh Jethva
by Atlantic.Net (511 posts) under Dedicated Server Hosting, Tutorials
0 Comments

Gatsby is a free and open-source framework based on the frontend development framework React. Gatsby allows developers to build fast, secure, and powerful websites using a React-based framework. With Gatsby, you can build a portfolio site or blog, or a high-traffic e-commerce store or company homepage. It follows the latest web standards and is optimized for speed and security. Gatsby brings the speed of a statically generated site as well as the functionality of a framework.

This post will show you how to install Gatsby on Oracle Linux 8.

Prerequisites

  • A server running Oracle Linux 8 on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Oracle Linux 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your server, run the following command to update your base system with the latest available packages.

dnf update -y

Step 2 – Install Node.js and NPM

Before starting, you will need to install Node.js and NPM on your server. By default, Node.js is included in the Oracle Linux default repo. You can list all available Node.js versions using the following command:

dnf module list nodejs

You should see the following output:

Last metadata expiration check: 0:56:42 ago on Tuesday 19 July 2022 03:11:19 AM EDT.
Oracle Linux 8 Application Stream (x86_64)
Name                     Stream                   Profiles                                                Summary                             
nodejs                   10 [d]                   common [d], development, minimal, s2i                   Javascript runtime                  
nodejs                   12                       common [d], development, minimal, s2i                   Javascript runtime                  
nodejs                   14                       common [d], development, minimal, s2i                   Javascript runtime                  
nodejs                   16                       common [d], development, minimal, s2i                   Javascript runtime                  

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Next, enable Node.js version 16 with the following command:

dnf module enable -y nodejs:16

You should get the following output:

Last metadata expiration check: 0:57:05 ago on Tuesday 19 July 2022 03:11:19 AM EDT.
Dependencies resolved.
==============================================================================================================================================
 Package                           Architecture                     Version                           Repository                         Size
==============================================================================================================================================
Enabling module streams:
 nodejs                                                             16                                                                       

Transaction Summary
==============================================================================================================================================

Complete!

Next, install Node.js and NPM using the following command:

dnf install -y nodejs npm

Next, install Git and Yarn package with the following command:

dnf install git
npm install -i yarn

Next, verify the Node.js version using the following command:

node -v

Output:

v16.14.0

To verify the NPM version, run the following command:

npm -v

Output:

8.3.1

Step 3 – Install Gatsby CLI

Gatsby provides a CLI tool that allows you to create and manage projects via the command line. You can install it using the NPM command as shown below:

npm install -g gatsby-cli

Once Gatsby is installed, you can verify it using the following command:

gatsby --version

You will get the following output:

Gatsby CLI version: 4.19.0

Step 4 – Create a New Site Using Gatsby

After installing Gatsby, run the following command to create a new site:

gatsby new

You will be asked to create a site name and other options during the site creation process. Once the site is created, you should see the following output:

  Welcome to Gatsby!

This command will generate a new Gatsby site for you in /root with the setup you select. Let's answer some questions:

What would you like to call your site?
✔ · My Gatsby Site
What would you like to name the folder where your site will be created?
✔ root/ my-gatsby-site
✔ Will you be using JavaScript or TypeScript?
· JavaScript
✔ Will you be using a CMS?
· No (or I'll add it later)
✔ Would you like to install a styling system?
· No (or I'll add it later)


Thanks! Here's what we'll now do:

    🛠  Create a new Gatsby site in the folder my-gatsby-site


✔ Created site from template
▸ Installing Gatsby...
✔ Created site from template
✔ Installed Gatsby
✔ Installed plugins
✔ Created site in my-gatsby-site

Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

Initial git commit failed - removing git support

🎉  Your new Gatsby site new has been successfully created
at /root/my-gatsby-site.
Start by going to the directory with

  cd my-gatsby-site

Start the local development server with

  npm run develop

See all commands at

  https://www.gatsbyjs.com/docs/gatsby-cli/

Now, change the directory to your site and run the following command to start the development server:

cd my-gatsby-site
gatsby develop -H 0.0.0.0

Once the server is started, you will get the following output:

You can now view my-gatsby-site in the browser.
⠀
  http://localhost:8000/
⠀
View GraphiQL, an in-browser IDE, to explore your site's data and schema
⠀
  http://localhost:8000/___graphql
⠀
Note that the development build is not optimized.
To create a production build, use gatsby build

You can also use the following options to start the development server:

  • -H, –host Set host. Defaults to localhost
  • -p, –port Set port. Defaults to env.PORT or 8000
  • -o, –open Open the site in your (default) browser for you
  • -S, –https Use HTTPS

Step 5 – Access Gatsby Web Interface

At this point, Gatsby is installed, started, and listens on port 8000. You can now access it using the URL http://your-server-ip:8000. You should see the Gatsby default page on the following screen:
Gatsby dashboard page

Conclusion

In this post, you learned how to install Gatsby on Oracle Linux 8. Gatsby is very useful for e-commerce developers to make blazing-fast stores in minimal time. Try it on dedicated hosting from Atlantic.Net!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

How to Set Up Kubernetes Cluster Using Minikube on Arch Linux
How to Install Jenkins on Arch Linux
Which Compliance Standards Require an IPS?
Install Netdata Monitoring Tool on Arch Linux
How to Install Vue.js on Arch Linux

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2008 Lookout Dr,

Garland, Texas 75044

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources