diff --git a/docs/guides/development/javascript/build-mern-stack-chat-application/examples/client/App.js b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/client/App.js
new file mode 100644
index 00000000000..06b3b6eb5ae
--- /dev/null
+++ b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/client/App.js
@@ -0,0 +1,19 @@
+// Import React and the stylesheet.
+import React from 'react';
+import './App.css';
+
+// Import the component to be used for fetching, posting,
+// and displaying messages from the server.
+import Messages from './Messages';
+
+// Initialize the application display, giving a
+// placeholder for the Messages component.
+function App() {
+ return (
+
+
+
+ );
+}
+
+export default App;
diff --git a/docs/guides/development/javascript/build-mern-stack-chat-application/examples/client/Messages.js b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/client/Messages.js
new file mode 100644
index 00000000000..1debe58b660
--- /dev/null
+++ b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/client/Messages.js
@@ -0,0 +1,79 @@
+// Import React's Component and Axios.
+import React, { Component } from 'react';
+import axios from 'axios';
+
+// Create the component for handling messages.
+class Messages extends Component {
+ // Create an object to hold the list of messages and the message
+ // being prepared for sending.
+ state = {
+ list: [],
+ toSend: ""
+ };
+
+ // When the component loads, get existing messages from the server.
+ componentDidMount() {
+ this.fetchMessages();
+ }
+
+ // Get messages from the server.
+ fetchMessages = () => {
+ axios
+ .get('/messages')
+ .then((res) => {
+ if (res.data) {
+ this.setState({ list: res.data, toSend: "" });
+ let inputField = document.getElementById("textInputField");
+ inputField.value = "";
+ } else {
+ this.setState({ list: ["No messages!"] });
+ }
+ })
+ .catch((err) => console.log(err));
+ }
+
+ // Post new messages to the server, and make a call to update
+ // the list of messages.
+ sendMessage = () => {
+ if (this.state.toSend === "") {
+ console.log("Enter message text.")
+ } else {
+ axios
+ .post('/messages', { messageText: this.state.toSend })
+ .then((res) => {
+ if (res.data) {
+ this.fetchMessages();
+ }
+ })
+ .catch((err) => console.log(err));
+ }
+ }
+
+ // Display the list of messages.
+ listMessages = () => {
+ if (this.state.list && this.state.list.length > 0) {
+ return (this.state.list.map((message) => {
+ return (
+
+ );
+ }
+}
+
+export default Messages;
diff --git a/docs/guides/development/javascript/build-mern-stack-chat-application/examples/server/index.js b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/server/index.js
new file mode 100644
index 00000000000..f99d721807e
--- /dev/null
+++ b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/server/index.js
@@ -0,0 +1,54 @@
+// Set up ExpressJS.
+const express = require("express");
+const bodyParser = require('body-parser');
+const app = express();
+const router = express.Router();
+const port = 5000;
+
+// Set up Mongoose.
+const mongoose = require('mongoose');
+const mongoDbUrl = 'mongodb://127.0.0.1/example_database';
+
+// Import MongoDB models.
+const MessageModel = require('./models/message.js');
+
+// Connect to the database.
+mongoose
+ .connect(mongoDbUrl, {useNewUrlParser: true, useUnifiedTopology: true})
+ .then(() => console.log('Database connection established.'))
+ .catch((err) => console.log('Database connection error: ' + err))
+mongoose.Promise = global.Promise;
+
+// Prevent possible cross-origin issues.
+app.use((req, res, next) => {
+ res.header('Access-Control-Allow-Origin', '*');
+ res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
+ next();
+});
+
+// Necessary to handle the JSON data.
+app.use(bodyParser.json());
+
+// Create endpoints for the frontend to access.
+app.get('/messages', (req, res, next) => {
+ MessageModel
+ .find({}, 'messageText')
+ .then((data) => res.json(data))
+ .catch(next);
+});
+
+app.post('/messages', (req, res, next) => {
+ if (req.body.messageText) {
+ MessageModel.create(req.body)
+ .then((data) => res.json(data))
+ .catch(next);
+ } else {
+ res.json({error: "Please provide message text."});
+ }
+});
+
+// Listen on the port.
+app.listen(port, () => {
+ console.log(`Server is running on port: ${port}`);
+});
+
diff --git a/docs/guides/development/javascript/build-mern-stack-chat-application/examples/server/message.js b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/server/message.js
new file mode 100644
index 00000000000..e331822d267
--- /dev/null
+++ b/docs/guides/development/javascript/build-mern-stack-chat-application/examples/server/message.js
@@ -0,0 +1,16 @@
+// Set up Mongoose.
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+
+// Create a schema to be used for the MessageModel.
+const MessageSchema = new Schema({
+ messageText: {
+ type: String,
+ required: [true, 'This fields is required.'],
+ },
+});
+
+// Create the message model from the MessageSchema.
+const MessageModel = mongoose.model('message', MessageSchema);
+
+module.exports = MessageModel;
diff --git a/docs/guides/development/javascript/build-mern-stack-chat-application/index.md b/docs/guides/development/javascript/build-mern-stack-chat-application/index.md
new file mode 100644
index 00000000000..2b254f5e0d2
--- /dev/null
+++ b/docs/guides/development/javascript/build-mern-stack-chat-application/index.md
@@ -0,0 +1,480 @@
+---
+slug: build-mern-stack-chat-application
+title: "Build a Basic Chat Application using the MERN Stack"
+description: "Learn how to develop a MERN stack app for an Ubuntu or Debian server."
+authors: ["Nathaniel Stickman"]
+contributors: ["Nathaniel Stickman"]
+published: 2023-09-14
+modified: 2024-05-06
+keywords: ['mern stack','mern tutorial','mern app']
+license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
+external_resources:
+- '[MongoDB: How to Use MERN Stack](https://www.mongodb.com/languages/mern-stack-tutorial)'
+- '[Mozilla Developer Network Web Docs: Express Tutorial Part 3: Using a Database (with Mongoose)](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose)'
+---
+
+MERN is a modern web application development stack consisting of MongoDB, Express JS, React, and Node.js. Its bundle of robust and well-supported open-source software provides a solid foundation for building a wide range of web applications.
+
+The MERN stack has the advantage of using React. Other variants exist, like the MEAN stack (which uses Angular) and the MEVN stack (which uses Vue). But with React, you get the advantage of server-side rendering and improved availability for web crawlers.
+
+This MERN tutorial helps you get started building a MERN app of your own for an Ubuntu 20.04 or Debian 10 server.
+
+## Before You Begin
+
+1. Familiarize yourself with our [Getting Started with Linode](/docs/getting-started/) guide, and complete the steps for setting your Linode's hostname and timezone.
+
+1. This guide uses `sudo` wherever possible. Complete the sections of our [How to Secure Your Server](/docs/security/securing-your-server/) guide to create a standard user account, harden SSH access, and remove unnecessary network services.
+
+1. Update your system using the following command:
+
+ ```command
+ sudo apt update && sudo apt upgrade
+ ```
+
+{{< note >}}
+The steps in this guide are written for non-root users. Commands that require elevated privileges are prefixed with `sudo`. If you’re not familiar with the `sudo` command, see the [Linux Users and Groups](/docs/tools-reference/linux-users-and-groups/) guide.
+{{< /note >}}
+
+## What Is MERN Stack?
+
+A MERN architecture is a full-stack framework for developing modern web applications. It is a variation of the MEAN stack but replaces Angular (the **A**) with React.
+
+A MERN stack is made up of the following components:
+
+- [MongoDB](https://www.mongodb.com/) document database
+- [Express JS](https://expressjs.com/) server-side framework
+- [React](https://reactjs.org/) client-side framework
+- [Node](https://nodejs.org/en/about/) web server
+
+Each of these technologies is well-supported and offers robust features. This makes a MERN stack a good choice for developing new web applications.
+
+## How to Develop a MERN App
+
+This section walks you through installing MongoDB and Node.js then setting up an Express JS server and React frontend. By the end, you have a complete MERN app, ready to be customized and expanded to your needs.
+
+After building the application, the last section of this guide shows you how to start up your MERN stack and test it out.
+
+### Install the Prerequisites
+
+Two of the MERN components should be installed before you start on your project: MongoDB and Node.js. Once you have them installed, you can create a project, where you install Express JS and React as dependencies.
+
+#### Install MongoDB
+
+1. Install `gnupg` using the following command:
+
+ ```command
+ sudo apt install gnupg
+ ```
+
+1. Import the GPG key for MongoDB.
+
+ ```command
+ wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
+ ```
+
+1. Add the MongoDB package list to APT.
+
+ {{< tabs >}}
+ {{< tab "Debian 10 (Buster)" >}}
+ ```command
+ echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
+ ```
+ {{< /tab >}}
+ {{< tab "Ubuntu 20.04 (Focal)" >}}
+ ```command
+ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
+ ```
+ {{< /tab >}}
+ {{< /tabs >}}
+
+1. Update the APT package index using the following command:
+
+ ```command
+ sudo apt update
+ ```
+
+1. Install MongoDB using the following command:
+
+ ```command
+ sudo apt install mongodb-org
+ ```
+
+See the official documentation for more on installing MongoDB [on Debian](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/) and [on Ubuntu](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/). You can also refer to our [How To Install MongoDB on Ubuntu 16.04](/docs/guides/install-mongodb-on-ubuntu-16-04/) guide.
+
+#### Install Node.js
+
+1. Install the Node Version Manager, the preferred method for installing Node.js.
+
+ ```command
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
+ ```
+
+1. Restart your shell session (logging out and logging back in), or run the following commands:
+
+ ```command
+ export NVM_DIR="$HOME/.nvm"
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
+ ```
+
+1. Install the current version of Node.js:
+
+ ```command
+ nvm install node
+ ```
+
+You can additionally refer to our [How to Install and Use the Node Package Manager (NPM) on Linux](/docs/guides/install-and-use-npm-on-linux/#how-to-install-or-update-npm) guide.
+
+### Developing the App
+
+The MERN app project itself consists of two components:
+
+- Express JS provides the backend web API, connecting to MongoDB to store and retrieve data
+- React provides the frontend, giving the user interface for interacting with the application
+
+The next sections show you how to set these up for a basic chat application.
+
+#### Create the Express JS Server
+
+1. Create a directory for your project, and then a subdirectory for your Express JS server. Then, change into the Express JS subdirectory.
+
+ This example creates a project directory under the current user's home directory and an Express JS subdirectory named `server`.
+
+ ```command
+ mkdir -p ~/example-mern-app/server
+ cd ~/example-mern-app/server
+ ```
+
+1. Initialize a Node.js project, and install Express JS. At the same time, install the Mongoose module for working with MongoDB:
+
+ ```command
+ npm init -y
+ npm install --save express mongoose
+ ```
+
+1. Create an `index.js` file, and give it the contents shown below. The purpose of each part of this code is elaborated in comments within the code:
+
+ ```file {title="index.js" lang="js"}
+ // Set up ExpressJS.
+ const express = require("express");
+ const bodyParser = require('body-parser');
+ const app = express();
+ const router = express.Router();
+ const port = 5000;
+
+ // Set up Mongoose.
+ const mongoose = require('mongoose');
+ const mongoDbUrl = 'mongodb://127.0.0.1/example_database';
+
+ // Import MongoDB models.
+ const MessageModel = require('./models/message.js');
+
+ // Connect to the database.
+ mongoose
+ .connect(mongoDbUrl, {useNewUrlParser: true, useUnifiedTopology: true})
+ .then(() => console.log('Database connection established.'))
+ .catch((err) => console.log('Database connection error: ' + err))
+ mongoose.Promise = global.Promise;
+
+ // Prevent possible cross-origin issues.
+ app.use((req, res, next) => {
+ res.header('Access-Control-Allow-Origin', '*');
+ res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
+ next();
+ });
+
+ // Necessary to handle the JSON data.
+ app.use(bodyParser.json());
+
+ // Create endpoints for the frontend to access.
+ app.get('/messages', (req, res, next) => {
+ MessageModel
+ .find({}, 'messageText')
+ .then((data) => res.json(data))
+ .catch(next);
+ });
+
+ app.post('/messages', (req, res, next) => {
+ if (req.body.messageText) {
+ MessageModel.create(req.body)
+ .then((data) => res.json(data))
+ .catch(next);
+ } else {
+ res.json({error: "Please provide message text."});
+ }
+ });
+
+ // Listen on the port.
+ app.listen(port, () => {
+ console.log(`Server is running on port: ${port}`);
+ });
+ ```
+
+ You can, alternatively, download the [above file](examples/server/index.js) directly.
+
+1. Create a `models` directory, and create a `message.js` file in it. Give the file the following contents:
+
+ ```file {title="models/message.js" lang="js"}
+ // Set up Mongoose.
+ const mongoose = require('mongoose');
+ const Schema = mongoose.Schema;
+
+ // Create a schema to be used for the MessageModel.
+ const MessageSchema = new Schema({
+ messageText: {
+ type: String,
+ required: [true, 'This fields is required.'],
+ },
+ });
+
+ // Create the message model from the MessageSchema.
+ const MessageModel = mongoose.model('message', MessageSchema);
+
+ module.exports = MessageModel;
+ ```
+
+ As above, you can also download [this file](examples/server/message.js) directly.
+
+1. To verify that everything is working, start the MongoDB service and run the Express JS server with the following commands:
+
+ ```command
+ sudo systemctl start mongod
+ node index.js
+ ```
+
+ Upon execution of the commands above, you should observe the following output:
+
+ ```output
+ Server is running on port: 5000
+ Database connection established.
+ ```
+
+1. You can make sure that the endpoints are working with the following two cURL commands:
+
+ ```command
+ curl -X POST -H "Content-Type: application/json" -d '{"messageText":"This is a test."}' localhost:5000/messages
+ curl localhost:5000/messages
+ ```
+
+ Upon execution of the commands above, you should observe the following output:
+
+ ```output
+ [{"_id":"61784e4251b2842f3ffe6eaf", "messageText":"This is a test."}]
+ ```
+
+ Once you have seen that the server is working, you can stop it with the Ctrl + C combination.
+
+1. To run the Express JS server and React simultaneously, the [Start MERN Stack Services](#start-mern-stack-services) section below uses the `concurrently` Node.js module. Install the module using the command below:
+
+ ```command
+ npm install --save-dev concurrently
+ ```
+
+1. Open the `package.json` file, and change the `scripts` portion as shown below. This allows you to start the server and frontend simultaneously with a single command:
+
+ ```file {title="package.json" lang="json"}
+ {
+ //...
+ "scripts": {
+ "server": "node index.js",
+ "client": "cd ../client && npm start",
+ "app_stack": "concurrently \"npm run server\" \"npm run client\""
+ },
+ //...
+ }
+ ```
+
+You can learn more about getting started with Express JS in our guide [Express JS Tutorial: Get Started Building a Website](/docs/guides/express-js-tutorial/).
+
+#### Create the React Frontend
+
+1. Change into the main project directory, and use the React project creation tool to initialize a React app. This example names the React project `client`.
+
+ ```command
+ cd ~/example-mern-app
+ npx create-react-app client
+ ```
+
+1. Change into the new React directory, and install the `axios` module. This facilitates making requests from the frontend to the Express JS server.
+
+ ```command
+ npm install --save axios
+ ```
+
+1. Open the `App.js` file, and give it the contents shown below. This requires you to delete the file's existing contents. You can find comments throughout the code elaborating on each part.
+
+ ```file {title="App.js" lang="js"}
+ // Import React and the stylesheet.
+ import React from 'react';
+ import './App.css';
+
+ // Import the component to be used for fetching, posting,
+ // and displaying messages from the server.
+ import Messages from './Messages';
+
+ // Initialize the application display, giving a
+ // placeholder for the Messages component.
+ function App() {
+ return (
+
+
+
+ );
+ }
+
+ export default App;
+ ```
+
+ You can also download [this file](examples/client/App.js) directly.
+
+1. Create a `Messages.js` file, and give it the contents shown below:
+
+ ```file {title="Messages.js" lang="js"}
+ // Import React's Component and Axios.
+ import React, { Component } from 'react';
+ import axios from 'axios';
+
+ // Create the component for handling messages.
+ class Messages extends Component {
+ // Create an object to hold the list of messages and the message
+ // being prepared for sending.
+ state = {
+ list: [],
+ toSend: ""
+ };
+
+ // When the component loads, get existing messages from the server.
+ componentDidMount() {
+ this.fetchMessages();
+ }
+
+ // Get messages from the server.
+ fetchMessages = () => {
+ axios
+ .get('/messages')
+ .then((res) => {
+ if (res.data) {
+ this.setState({ list: res.data, toSend: "" });
+ let inputField = document.getElementById("textInputField");
+ inputField.value = "";
+ } else {
+ this.setState({ list: ["No messages!"] });
+ }
+ })
+ .catch((err) => console.log(err));
+ }
+
+ // Post new messages to the server, and make a call to update
+ // the list of messages.
+ sendMessage = () => {
+ if (this.state.toSend === "") {
+ console.log("Enter message text.")
+ } else {
+ axios
+ .post('/messages', { messageText: this.state.toSend })
+ .then((res) => {
+ if (res.data) {
+ this.fetchMessages();
+ }
+ })
+ .catch((err) => console.log(err));
+ }
+ }
+
+ // Display the list of messages.
+ listMessages = () => {
+ if (this.state.list && this.state.list.length > 0) {
+ return (this.state.list.map((message) => {
+ return (
+
+ );
+ }
+ }
+
+ export default Messages;
+ ```
+ As before, you can also download [this file](examples/client/Messages.js) directly.
+
+1. Open the `package.json` file, and add the line shown below. This allows you to use shorthand for the Express JS server endpoints, which you can see in the `Messages.js` file above.
+
+ ```file {title="package.json" lang="json"}
+ {
+ //...
+ "proxy": "localhost:5000"
+ }
+ ```
+
+1. Verify that the frontend is working by starting it up using the following command:
+
+ ```command
+ npm start
+ ```
+
+ You can see the front end by navigating to `localhost:3000`.
+
+ Stop the frontend server at any time with the Ctrl + C key combination.
+
+To learn more about building applications with React, refer to the [official documentation](https://reactjs.org/docs/getting-started.html).
+
+### Start MERN Stack Services
+
+With the prerequisites installed and the project set up, you can now start up your new MERN app. These steps show you how to get all of the necessary parts running and then connect to your application, even remotely.
+
+1. Start the MongoDB service.
+
+ ```command
+ sudo systemctl start mongod
+ ```
+
+1. Enable the legacy OpenSSL provider in Node.js, required to run React:
+
+ ```command
+ export NODE_OPTIONS=--openssl-legacy-provider
+ ```
+
+ To make this configuration persistent, add the line above to your `~/.bashrc` file.
+
+1. Change into the project's `server` directory, and execute the command below:
+
+ ```command
+ npm run app_stack
+ ```
+
+ Your MERN stack application should now be running. Access the frontend by navigating to `localhost:3000` in a browser. You can access the application remotely using an SSH tunnel:
+
+ - On **Windows**, use the PuTTY tool to set up your SSH tunnel. Follow the appropriate section of the [Setting up an SSH Tunnel with Your Linode for Safe Browsing](/docs/guides/setting-up-an-ssh-tunnel-with-your-linode-for-safe-browsing/#windows) guide, replacing the example port number there with `3000`.
+
+ - On **macOS** or **Linux**, use the following command to set up the SSH tunnel. Replace `example-user` with your username on the application server and `192.0.2.0` with the server's IP address.
+
+ ```command
+ ssh -L3000:localhost:3000 example-user@192.0.2.0
+ ```
+
+ 
+
+When you are ready to make your application accessible to the public, take a look at our [Deploying a React Application on Debian 10](/docs/guides/how-to-deploy-a-react-app-on-debian-10/) guide. Specifically, the [Configure your Web Server](/docs/guides/how-to-deploy-a-react-app-on-debian-10/#configure-your-web-server) and [Create your Deployment Script](/docs/guides/how-to-deploy-a-react-app-on-debian-10/#create-your-deployment-script) sections give you the additional steps you need to make your React frontend available.
+
+## Conclusion
+
+You now have a working MERN stack application. This code above can form a basis that you can modify and expand on to your needs.
+
+Ready to deploy your MERN stack app to a server? Refer to our [Deploy a MERN Stack Application on Akamai](/docs/guides/deploy-a-mern-stack-application/) guide. There, you can learn how to set up a server for a MERN stack and copy over your MERN project for deployment.
+
+One way you can enhance your MERN stack app is by adding authentication. Learn how to implement authentication into your Express JS server through our [User Authentication with JSON Web Tokens (JWTs) and Express](/docs/guides/how-to-authenticate-using-jwt/) guide.
\ No newline at end of file
diff --git a/docs/guides/development/javascript/build-mern-stack-chat-application/mern-app-example.png b/docs/guides/development/javascript/build-mern-stack-chat-application/mern-app-example.png
new file mode 100644
index 00000000000..9c2a844f0ac
Binary files /dev/null and b/docs/guides/development/javascript/build-mern-stack-chat-application/mern-app-example.png differ
diff --git a/docs/guides/development/javascript/deploy-a-mern-stack-application/index.md b/docs/guides/development/javascript/deploy-a-mern-stack-application/index.md
new file mode 100644
index 00000000000..ee1fcec3af1
--- /dev/null
+++ b/docs/guides/development/javascript/deploy-a-mern-stack-application/index.md
@@ -0,0 +1,379 @@
+---
+slug: deploy-a-mern-stack-application
+title: "Deploy a MERN Stack Application on Akamai"
+description: "Learn how to deploy a locally developed MERN stack app to Akamai two different ways."
+authors: ["Nathaniel Stickman", "Linode"]
+contributors: ["Nathaniel Stickman", "Linode"]
+published: 2023-09-14
+modified: 2024-05-06
+keywords: ['deploy react app','mern stack','how to deploy react app']
+license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
+external_resources:
+- '[MongoDB: MERN Stack Explained](https://www.mongodb.com/mern-stack)'
+- '[GitHub: rfdickerson/mern-example: MERN Stack Starter](https://github.com/rfdickerson/mern-example)'
+---
+
+MERN is a stack for modern web applications. It consists of MongoDB, Express JS, React, and Node.js — all well-established open-source technologies that make a solid foundation for new web applications.
+
+This guide helps you deploy your existing MERN stack project onto Akamai cloud compute, using the MERN Marketplace App or by manually installing the MERN stack on a new Compute Instance. After your server is set up, learn how to copy your project to your server. If you do not yet have an existing project and wish to create a new MERN application, review one of the following guides instead:
+
+- [Install the MERN Stack and Create an Example Application](/docs/guides/install-the-mern-stack/)
+
+- [Build a Basic Chat Application using the MERN Stack](/docs/guides/build-mern-stack-chat-application/)
+
+## Before You Begin
+
+1. Familiarize yourself with our [Getting Started with Linode](/docs/getting-started/) guide, and complete the steps for setting your Linode's hostname and timezone.
+
+1. This guide uses `sudo` wherever possible. Complete the sections of our [How to Secure Your Server](/docs/security/securing-your-server/) guide to create a standard user account, harden SSH access, and remove unnecessary network services.
+
+1. Update your system using the following command:
+
+ ```command
+ sudo apt update && sudo apt upgrade
+ ```
+
+{{< note >}}
+The steps in this guide are written for non-root users. Commands that require elevated privileges are prefixed with `sudo`. If you’re not familiar with the `sudo` command, see the [Linux Users and Groups](/docs/tools-reference/linux-users-and-groups/) guide.
+{{< /note >}}
+
+## What Is the MERN Stack?
+
+A MERN architecture is a full-stack framework for developing modern web applications. It is a variation of the MEAN stack, but replaces Angular (the **A**) with React.
+
+A MERN stack is made up of the following components:
+
+- [MongoDB](https://www.mongodb.com/) document database
+- [Express JS](https://expressjs.com/) server-side framework
+- [React](https://reactjs.org/) client-side framework
+- [Node](https://nodejs.org/en/about/) web server
+
+Each of these technologies is well-supported and offers robust features. This makes a MERN stack a good choice for developing new web applications.
+
+As noted above, other variants exist, like the MEAN stack (which uses Angular) and the MEVN stack (which uses Vue). But MERN uses React, so you get the advantages of its server-side rendering and improved availability for web crawlers.
+
+## Deploy the MERN Stack on Akamai
+
+To deploy a functional MERN stack on a server, select from one of the deployment options below:
+
+- **Linode Marketplace:** Deploy the [MERN App](https://www.linode.com/marketplace/apps/linode/mern/) through the Linode Marketplace to automatically install MongoDB, Node.JS, Express, and React. This is the easiest method and enables you to quickly get up and running without needing to install and configure everything manually. Just note, when choosing this method you are limited to the distribution images supported by the Marketplace App.
+
+- **Manual Installation:** If you wish to have full control over application versions and the initial configuration, you can manually install all required components. To do so, follow the [Manually Install the MERN Stack](#manually-install-the-mern-stack) section below.
+
+### Manually Install the MERN Stack
+
+To install the components for a MERN stack yourself, you can follow the steps below. These walk you through installing MongoDB and Node.js and adding Express JS and React to your project if they are not already added.
+
+Further on, you can also see how to start up your MERN stack application once all of the components have been installed. By the end, you have a functioning MERN application running on your server.
+
+To get started, you need to install each of the components that make up a MERN stack. For Express JS and React, this typically means starting a Node.js project and setting up Express JS and React as dependencies.
+
+### Install MongoDB
+
+1. Install `gnupg` using the following command:
+
+ ```command
+ sudo apt install gnupg
+ ```
+
+1. Import the GPG key for MongoDB.
+
+ ```command
+ wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
+ ```
+
+1. Add the MongoDB package list to APT.
+
+ {{< tabs >}}
+ {{< tab "Debian 10 (Buster)" >}}
+ ```command
+ echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
+ ```
+ {{< /tab >}}
+ {{< tab "Ubuntu 20.04 (Focal)" >}}
+ ```command
+ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
+ ```
+ {{< /tab >}}
+ {{< /tabs >}}
+
+1. Update the APT package index using the following command:
+
+ ```command
+ sudo apt update
+ ```
+
+1. Install MongoDB using the following command:
+
+ ```command
+ sudo apt install mongodb-org
+ ```
+
+See the official documentation for more on installing MongoDB [on Debian](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/) and [on Ubuntu](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/). You can also refer to our guide [How To Install MongoDB on Ubuntu 16.04](/docs/guides/install-mongodb-on-ubuntu-16-04/).
+
+### Install Node.js
+
+1. Install the Node Version Manager, the preferred method for installing Node.js.
+
+ ```command
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
+ ```
+
+1. Restart your shell session (logging out and logging back in), or run the following commands:
+
+ ```command
+ export NVM_DIR="$HOME/.nvm"
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
+ ```
+
+1. Install the current version of Node.js:
+
+ ```command
+ nvm install node
+ ```
+
+1. If your project uses the Yarn package manager instead of NPM, you need to install Yarn as well. You can do so with:
+
+ ```command
+ npm install -g yarn
+ ```
+
+You can additionally refer to our [How to Install and Use the Node Package Manager (NPM) on Linux](/docs/guides/install-and-use-npm-on-linux/#how-to-install-or-update-npm) guide. If you are interested in using Yarn instead of NPM, take a look at our [How to Install and Use the Yarn Package Manager](/docs/guides/install-and-use-the-yarn-package-manager/) guide.
+
+### Install Express JS
+
+If you have an existing MERN project using Express JS, you only need to install the project's Node.js dependencies. Doing so is covered in the [Upload Your Application](#upload-your-application) section.
+
+Otherwise, you can add Express JS as a dependency to your NPM project using this command. This also adds the Mongoose module, which is typically the module used for connecting to MongoDB from Express JS.
+
+```command
+npm install --save express mongoose
+```
+
+If you are working on a Yarn project, use the command below instead:
+
+```command
+yarn add express mongoose
+```
+
+Learn more about getting started with Express JS in our guide [Express JS Tutorial: Get Started Building a Website](/docs/guides/express-js-tutorial/).
+
+### Install React (if necessary for server-side rendering)
+
+As with Express JS, you only need to install your Node.js dependencies if you already have React in your existing MERN project. This guide covers installing those dependencies in the [Upload Your Application](#upload-your-application) section.
+
+Otherwise, you can add React to your NPM project with a command like the one here. This also includes the Axios module, typically used for communications between React and the Express JS server.
+
+```command
+npm install --save react react-dom axios
+```
+
+Alternatively, use a command like the next one if your project uses Yarn instead of NPM.
+
+```command
+yarn add react react-dom axios
+```
+
+Find out more about building applications with React from the [official documentation](https://reactjs.org/docs/getting-started.html) and in our guide [Deploying a React Application on Debian 10](/docs/guides/how-to-deploy-a-react-app-on-debian-10/#create-an-example-react-app).
+
+## Upload Your Application
+
+There are two recommended methods for getting your locally-developed MERN project onto your server instance:
+
+- Copy your code to the server over SSH. You can use the `scp` command to do so, even on Windows. This method works well if you subsequently intend to work with the project files on the server exclusively.
+
+- House your MERN stack code in a remote Git repository. Then, pull your code down from the remote repository to your server. While requiring more effort to set up, this method helps keep your project consistent as you work on it across multiple machines.
+
+Below, you can find instructions for each of these methods.
+
+### Copy a Project to a Server Using SCP
+
+To follow along, you can download the [MERN stack starter](https://github.com/rfdickerson/mern-example) project, a small project demonstrating how a MERN stack application works.
+
+1. Using `scp`, copy your project's directory to the server.
+
+ - On **Linux** and **macOS**, execute a command like the one below. Replace the path to your MERN project directory with the actual path. Likewise, replace `example-user` with your user on the server instance and `192.0.2.0` with the instance's IP address.
+
+ ```command
+ scp -r ~/mern-example example-user@192.0.2.0:~/
+ ```
+
+ - On **Windows**, you first need to open port **22** on the server instance. Log into your server instance, and use UFW to open port **22**.
+
+ ```command
+ sudo ufw allow 22
+ sudo ufw reload
+ ```
+
+ The above commands require you to have the UFW utility installed. It comes pre-installed if you use the Linode Marketplace one-click app. Otherwise, you can learn how to use UFW from our [How to Secure Your Server](/docs/security/securing-your-server/) guide discussed above.
+
+ You can now use `scp` from your Windows machine, with a command like the one below. Replace the path to your MERN project folder with the actual path. Likewise, replace `example-user` with your user on the server instance and `192.0.2.0` with the instance's IP address:
+
+ ```command
+ scp -r "C:\mern-example" example-user@192.0.2.0:~/
+ ```
+
+1. Delete the `node_modules` directory from the copy of the project on your server. It is best to reinstall these due to potential system differences affecting the modules. Replace the path given below with the actual path to your project's `node_modules` directory.
+
+ ```command
+ rm -r ~/mern-example/node_modules
+ ```
+
+ Your project may have more than one such directory, depending on whether the Express JS and React portions were created as separate NPM/Yarn projects. Be sure to remove each `node_modules` directory.
+
+### Set Up Git Version Control for Your Project
+
+Take a look at our guide [Introduction to Version Control](/docs/guides/introduction-to-version-control/#installing-git) to learn more about using Git for version control.
+
+The examples in the steps below use GitHub. They assume you have a GitHub account and have created a blank repository on GitHub for pushing your MERN project. You can learn how to create a repository on GitHub using the steps in GitHub's [official documentation](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository).
+
+This first set of steps needs to be taken on your local machine. It sets up your project as a Git repository and pushes it to the remote repository on GitHub.
+
+1. Ensure that Git is installed.
+
+ - On **Linux** systems, you can use your package manager. For instance, on **Debian** and **Ubuntu** use the following command:
+
+ ```command
+ sudo apt install git
+ ```
+
+ - On **macOS**, running the Git command should prompt you to install Git if it is not already installed.
+
+ ```command
+ git --version
+ ```
+
+ - On **Windows**, download the Git binary from the [official website](https://git-scm.com/download/win).
+
+1. Change into your project's directory, and make your project a Git repository if it is not already one. This example assumes your project is in the `mern-example` directory in your current user's home directory.
+
+ ```command
+ cd ~/mern-example
+ git init
+ ```
+
+1. Create a `.gitignore` file at the base of your project. If there are files or directories you do not want to be added to the remote Git repository, add patterns matching those files/directories to the `.gitignore` file. This should include a `/node_modules` pattern to ensure that the Node.js modules do not get carried over.
+
+ As an example, here is a typical `.gitignore` for a Node.js project.
+
+ ```file {title=".gitignore"}
+ .DS_STORE
+ /node_modules
+ /build
+ logs
+ *.log
+ npm-debug.log*
+ ```
+
+1. Add your project's files for staging to your first Git commit.
+
+ ```command
+ git add .
+ ```
+
+1. Commit the files. It is recommended that you add a brief descriptive comment to each commit you make, like below:
+
+ ```command
+ git commit -m "Initial commit."
+ ```
+
+1. Add the remote repository. Replace the URL in the example below with the URL for your remote repository.
+
+ ```command
+ git remote add origin https://github.com/example-user/example-repository.git
+ ```
+
+1. Push your local project to the remote repository.
+
+ ```command
+ git push -u origin master
+ ```
+
+These next steps then need to be taken on the server instance to pull down the project from the remote repository. You can use these steps with the [MERN stack starter](https://github.com/rfdickerson/mern-example) project to have a working example of how pulling down a repository works.
+
+1. Ensure that Git is installed using the following command:
+
+ ```command
+ sudo apt install git
+ ```
+
+1. Change into a directory where you want the project to live. Here, the current user's home directory is used.
+
+ ```command
+ cd ~
+ ```
+
+1. Clone the remote GitHub repository. As above, replace the URL here with the actual URL for your repository.
+
+ ```command
+ git clone https://github.com/rfdickerson/mern-example.git
+ ```
+
+## Install Your Application's Dependencies
+
+1. Now that the files are on your server instance, you need to reinstall the project's Node.js modules. To do so, change into the project directory, and execute one of the commands below.
+
+ - If you used NPM to install modules, use the following command:
+
+ ```command
+ npm install
+ ```
+
+ - If you used Yarn to install modules, use the following command:
+
+ ```command
+ yarn
+ ```
+
+ You can tell which one your project uses by searching its base directory. If you find a `yarn.lock` file, it should be a Yarn project. Otherwise, it should be an NPM project.
+
+ You may need to run the above commands in multiple directories within your project. This depends again on whether you set up Express JS and React as two separate NPM/Yarn projects.
+
+1. Depending on your Node.js and React versions, you may need to enable the legacy OpenSSL provider in Node.js. If you get an OpenSSL error when trying to run React, use the following command:
+
+ ```command
+ export NODE_OPTIONS=--openssl-legacy-provider
+ ```
+
+ To make this configuration persistent, add the line above to your `~/.bashrc` file.
+
+## Start Your Application
+
+1. Start the MongoDB service using the following command:
+
+ ```command
+ sudo systemctl start mongod
+ ```
+
+1. Change into the project's `server` directory, and start up the Express JS and React servers. The commands for this vary depending on your project configuration.
+
+ Typically, you can run an NPM project with a command like the following:
+
+ ```command
+ npm start
+ ```
+
+ Or, if your project uses an NPM script, you might run it with something like this, replacing `mern-project` with the name of the script:
+
+ ```command
+ npm run mern-project
+ ```
+
+ For the [MERN stack starter](https://github.com/rfdickerson/mern-example) project referenced as an example above, use the following command:
+
+ ```command
+ yarn start-dev
+ ```
+
+You can then visit your application in a browser. By default, React runs on `localhost:3000`, and that is the case for the example application referenced above. To access it remotely, you can use an SSH tunnel.
+
+- On **Windows**, use the PuTTY tool to set up your SSH tunnel. Follow the appropriate section of the [Setting up an SSH Tunnel with Your Linode for Safe Browsing](/docs/guides/setting-up-an-ssh-tunnel-with-your-linode-for-safe-browsing/#windows) guide, replacing the example port number there with **3000**.
+
+- On **macOS** or **Linux**, use the following command to set up the SSH tunnel. Replace `example-user` with your username on the application server and `192.0.2.0` with the server's IP address.
+
+ ```command
+ ssh -L3000:localhost:3000 example-user@192.0.2.0
+ ```
+
+
\ No newline at end of file
diff --git a/docs/guides/development/javascript/deploy-a-mern-stack-application/mern-app-example.png b/docs/guides/development/javascript/deploy-a-mern-stack-application/mern-app-example.png
new file mode 100644
index 00000000000..4ad34f55d5b
Binary files /dev/null and b/docs/guides/development/javascript/deploy-a-mern-stack-application/mern-app-example.png differ
diff --git a/docs/guides/development/javascript/how-to-create-a-mern-stack-application/index.md b/docs/guides/development/javascript/how-to-create-a-mern-stack-application/index.md
deleted file mode 100644
index 95e606cf591..00000000000
--- a/docs/guides/development/javascript/how-to-create-a-mern-stack-application/index.md
+++ /dev/null
@@ -1,278 +0,0 @@
----
-slug: how-to-create-a-mern-stack-application
-title: "Create a MERN Stack Application"
-title_meta: "How to Create a MERN Stack on Linux"
-description: "Learn how to create a MERN stack application on Linux. Read our guide to learn MERN stack basics. ✓ Click here!"
-authors: ["Cameron Laird"]
-contributors: ["Cameron Laird"]
-published: 2022-09-12
-modified: 2022-09-23
-keywords: ['MERN Stack Application','How to create a MERN stack application','MERN stack','MERN stack application', 'learn Linux filesystem', 'MERN stack on Linux']
-license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
-external_resources:
-- '[How to Use MERN Stack: A Complete Guide](https://www.mongodb.com/languages/mern-stack-tutorial)'
-- '[The MERN stack: A complete tutorial](https://blog.logrocket.com/mern-stack-tutorial/)'
-- '[Learn the MERN Stack - Full Tutorial for Beginners (MongoDB, Express, React, Node.js) in 12Hrs (2021)](https://www.youtube.com/watch?v=7CqJlxBYj-M)'
-- '[Learn the MERN Stack - Full Tutorial (MongoDB, Express, React, Node.js)](https://www.youtube.com/watch?v=7CqJlxBYj-M)'
----
-
-Of all the possible technical bases for a modern web site, ["MERN holds the leading position when it comes to popularity."](https://www.gkmit.co/blog/web-app-development/mean-vs-mern-stack-who-will-win-the-war-in-2021) This introduction makes you familiar with the essential tools used for a plurality of all web sites worldwide.
-
-## Before You Begin
-
-1. If you have not already done so, create a Linode account and Compute Instance. See our [Getting Started with Linode](/docs/products/platform/get-started/) and [Creating a Compute Instance](/docs/products/compute/compute-instances/guides/create/) guides.
-
-1. Follow our [Setting Up and Securing a Compute Instance](/docs/products/compute/compute-instances/guides/set-up-and-secure/) guide to update your system. You may also wish to set the timezone, configure your hostname, create a limited user account, and harden SSH access.
-
-{{< note >}}
-The steps in this guide require root privileges. Be sure to run the steps below as `root` or with the `sudo` prefix. For more information on privileges, see our [Users and Groups](/docs/guides/linux-users-and-groups/) guide.
-{{< /note >}}
-
-## What is the MERN stack?
-
-MERN refers to MongoDB, Express.js, ReactJS, and Node.js, four software tools which cooperate to power millions of web sites worldwide. In broad terms:
-
-* [**MongoDB**](/docs/guides/databases/mongodb/) manages data, such as customer information, technical measurements, and event records.
-* [**Express.js**](/docs/guides/express-js-tutorial/) is a web application framework for the "behaviors" of particular applications. For example, how data flows from catalog to shopping cart.
-* [**ReactJS**](/docs/guides/development/react/) is a library of user-interface components for managing the visual "state" of a web application.
-* [**Node.js**](/docs/guides/development/nodejs/) is a back-end runtime environment for the server side of a web application.
-
-Linode has [many articles](/docs/guides/) on each of these topics, and supports thousands of [Linode customers who have created successful applications](https://www.linode.com/content-type/spotlights/) based on these tools.
-
-One of MERN’s important distinctions is the [JavaScript programming language is used throughout](https://javascript.plainenglish.io/why-mern-stack-is-becoming-popular-lets-see-in-detail-8825fd3fd5ee) the entire stack. Certain competing stacks use PHP or Python on the back end, JavaScript on the front end, and perhaps SQL for data storage. MERN developers focus on just a single programming language, [JavaScript, with all the economies](https://javascript.plainenglish.io/should-you-use-javascript-for-everything-f98015ade40a) that implies, for training and tooling.
-
-## Install the MERN stack
-
-You can install a basic MERN stack on a 64-bit x86_64 [Linode Ubuntu 20.04 host](https://www.linode.com/distributions/) in under half an hour. As of this writing, parts of MERN for Ubuntu 22.04 remain experimental. While thousands of variations are possible, this section typifies a correct "on-boarding" sequence. The emphasis here is on "correct", as scores of already-published tutorials embed enough subtle errors to block their use by readers starting from scratch.
-
-### Install MongoDB
-
-1. Update the repository cache:
-
- apt update -y
-
-2. Install the networking and service dependencies Mongo requires:
-
- apt install ca-certificates curl gnupg2 systemctl wget -y
-
-3. Configure access to the official MongoDB Community Edition repository with the MongoDB public GPG key:
-
- wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add -
-
-4. Create a MongoDB list file:
-
- echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list
-
-5. Update the repository cache again:
-
- apt update -y
-
-6. Install MongoDB itself:
-
- apt install mongodb-org -y
-
-7. Enable and the MongoDB service:
-
- systemctl enable mongod
-
-8. Launch the MongoDB service:
-
- systemctl start mongod
-
-9. Verify the MongoDB service:
-
- systemctl status mongod
-
- You should see diagnostic information that concludes:
-
- {{< output >}}… Started MongoDB Database Server.{{< /output >}}
-
-0. For an even stronger confirmation that the Mongo server is ready for useful action, connect directly to it and issue this command:
-
- mongo
-
-1. Now issue this command:
-
- db.runCommand({ connectionStatus: 1 })
-
- You should see, along with many other details, this summary of the connectionStatus:
-
- {{< output >}}… MongoDB server … "ok" : 1 …{{< /output >}}
-
-2. Exit Mongo:
-
- exit
-
-### Install Node.js
-
-While the acronym is MERN, the true order of its dependencies is better written as "MNRE". ReactJS and Express.js conventionally require Node.js, so the next installation steps focus on Node.js. As with MongoDB, Node.js's main trusted repository is not available in the main Ubuntu repository.
-
-1. Run this command to adjoin it:
-
- curl -sL https://deb.nodesource.com/setup_16.x | bash -
-
-2. Install Node.js itself:
-
- apt-get install nodejs -y
-
-3. Verify the installation:
-
- node -v
-
- You should see `v16.15.1` or perhaps later.
-
-### Install React.js
-
-1. Next, install React.js:
-
- mkdir demonstration; cd demonstration
- npx --yes create-react-app frontend
- cd frontend
- npm run build
-
-Templates for all the HTML, CSS, and JS for your model application are now present in the demonstration/frontend directory.
-
-### Install Express.js
-
-1. Express.js is the final component of the basic MERN stack.
-
- cd ..; mkdir server; cd server
- npm init -y
- cd ..
- npm install cors express mongodb mongoose nodemon
-
-## Use the MERN stack to create an example application
-
-The essence of a web application is to respond to a request from a web browser with an appropriate result, backed by a datastore that "remembers" crucial information from one session to the next. Any realistic full-scale application involves account management, database backup, context dependence, and other refinements. Rather than risk the distraction and loss of focus these details introduce, this section illustrates the simplest possible use of MERN to implement a [three-tier operation](https://www.ibm.com/cloud/learn/three-tier-architecture) typical of real-world applications.
-
-"Three-tier" in this context refers to the teamwork web applications embody between:
-
-* The presentation in the web browser of the state of an application
-* The "back end" of the application which realizes that state
-* The datastore which supports the back end beyond a single session of the front end or even the restart of the back end.
-
-You can create a tiny application which receives a request from a web browser, creates a database record based on that request, and responds to the request. The record is visible within the Mongo datastore.
-
-### Initial configuration of the MERN application
-
-1. Create `demonstration/server/index.js` with this content:
-
- {{< file "demonstration/server/index.js" javascript >}}
-const express = require('express');
-const bodyParser = require('body-parser');
-const mongoose = require('mongoose');
-const routes = require('../routes/api');
-const app = express();
-const port = 4200;
-
-// Connect to the database
-mongoose
- .connect('mongodb://127.0.0.1:27017/', { useNewUrlParser: true })
- .then(() => console.log(`Database connected successfully`))
- .catch((err) => console.log(err));
-
-// Override mongoose's deprecated Promise with Node's Promise.
-mongoose.Promise = global.Promise;
-app.use((req, res, next) => {
- res.header('Access-Control-Allow-Origin', '*');
- res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
- next();
- });
- app.use(bodyParser.json());
- app.use('/api', routes);
- app.use((err, req, res, next) => {
- console.log(err);
- next();
- });
-
- app.listen(port, () => {
- console.log(`Server runs on port ${port}.`);
- });
-{{ file >}}
-
-2. Create `demonstration/routes/api.js` with this content:
-
- {{< file "demonstration/routes/api.js" javascript >}}
-const express = require('express');
-const router = express.Router();
-
-var MongoClient = require('mongodb').MongoClient;
-var url = 'mongodb://127.0.0.1:27017/';
-const mongoose = require('mongoose');
-var db = mongoose.connection;
-
-router.get('/record', (req, res, next) => {
- item = req.query.item;
- MongoClient.connect(url, function(err, db) {
- if (err) throw err;
- var dbo = db.db("mydb");
- var myobj = { name: item };
- dbo.collection("demonstration").insertOne(myobj, function(err, res) {
- if (err) throw err;
- console.log(`One item (${item}) inserted.`);
- db.close();
- })
- });
-})
-module.exports = router;
-{{ file >}}
-
-3. Create `demonstration/server/server.js` with this content:
-
- {{< file "demonstration/server/server.js" javascript >}}
-const express = require("express");
-const app = express();
-const cors = require("cors");
-require("dotenv").config({ path: "./config.env" });
-const port = process.env.PORT || 4200;
-app.use(cors());
-app.use(express.json());
-app.use(require("./routes/record"));
-const dbo = require("./db/conn");
-
-app.listen(port, () => {
- // Connect on start.
- dbo.connectToServer(function (err) {
- if (err) console.error(err);
- });
- console.log(`Server is running on port: ${port}`);
-});
-{{ file >}}
-
-### Verify your application
-
-1. Launch the application server:
-
- node server/index.js
-
-2. In a convenient Web browser, request:
-
- localhost:4200/api/record?item=this-new-item
-
- At this point, your terminal should display:
-
- {{< output >}}One item (this-new-item) inserted.{{< /output >}}
-
-3. Now launch an interactive shell to connect to the MongoDB datastore:
-
- mongo
-
-4. Within the MongoDB shell, request:
-
- use mydb
- db.demonstration.find({})
-
- Mongo should report that it finds a record:
-
- {{< output >}}{ "_id" : ObjectId("62c84fe504d6ca2aa325c36b"), "name" : "this-new-item" }{{< /output >}}
-
-This demonstrates a minimal MERN action:
-* The web browser issues a request with particular data.
-* The React front end framework routes that request.
-* The Express application server receives the data from the request, and acts on the MongoDB datastore.
-
-## Conclusion
-
-You now know how to install each of the basic components of the MERN stack on a standard Ubuntu 20.04 server, and team them together to demonstrate a possible MERN action: creation of one database record based on a browser request.
-
-Any real-world application involves considerably more configuration and source files. MERN enjoys abundant tooling to make the database and web connections more secure, to validate data systematically, to structure a [complete Application Programming Interface](https://www.mongodb.com/blog/post/the-modern-application-stack-part-3-building-a-rest-api-using-expressjs) (API), and to simplify debugging. Nearly all practical applications need to create records, update, delete, and list them. All these other refinements and extensions use the elements already present in the workflow above. You can build everything your full application needs from this starting point.
\ No newline at end of file
diff --git a/docs/guides/development/javascript/install-the-mern-stack/index.md b/docs/guides/development/javascript/install-the-mern-stack/index.md
new file mode 100644
index 00000000000..6435be4fa72
--- /dev/null
+++ b/docs/guides/development/javascript/install-the-mern-stack/index.md
@@ -0,0 +1,342 @@
+---
+slug: install-the-mern-stack
+title: "Install the MERN Stack and Create an Example Application"
+description: "Learn how to create a MERN stack application on Linux. Read our guide to learn MERN stack basics."
+authors: ["Cameron Laird", "Nathaniel Stickman"]
+contributors: ["Cameron Laird", "Nathaniel Stickman"]
+published: 2022-09-12
+modified: 2024-05-06
+keywords: ['MERN Stack Application','How to create a MERN stack application','MERN stack','MERN stack application', 'learn Linux filesystem', 'MERN stack on Linux']
+license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
+external_resources:
+- '[How to Use MERN Stack: A Complete Guide](https://www.mongodb.com/languages/mern-stack-tutorial)'
+- '[The MERN stack: A complete tutorial](https://blog.logrocket.com/mern-stack-tutorial/)'
+- '[Learn the MERN Stack - Full Tutorial for Beginners (MongoDB, Express, React, NodeJS) in 12Hrs (2021)](https://www.youtube.com/watch?v=7CqJlxBYj-M)'
+- '[Learn the MERN Stack - Full Tutorial (MongoDB, Express, React, Node.js)](https://www.youtube.com/watch?v=7CqJlxBYj-M)'
+aliases: ['/guides/how-to-create-a-mern-stack-application/']
+---
+
+Of all the possible technical bases for a modern website, ["MERN holds the leading position when it comes to popularity."](https://www.gkmit.co/blog/web-app-development/mean-vs-mern-stack-who-will-win-the-war-in-2021) This introduction makes you familiar with the essential tools used for a plurality of all websites worldwide.
+
+## Before You Begin
+
+1. If you have not already done so, create a Linode account and Compute Instance. See our [Getting Started with Linode](/docs/products/platform/get-started/) and [Creating a Compute Instance](/docs/products/compute/compute-instances/guides/create/) guides.
+
+1. Follow our [Setting Up and Securing a Compute Instance](/docs/products/compute/compute-instances/guides/set-up-and-secure/) guide to update your system. You may also wish to set the timezone, configure your hostname, create a limited user account, and harden SSH access.
+
+{{< note >}}
+The steps in this guide require root privileges. Be sure to run the steps below as `root` or with the `sudo` prefix. For more information on privileges, see our [Linux Users and Groups](/docs/guides/linux-users-and-groups/) guide.
+{{< /note >}}
+
+## What Is the MERN Stack?
+
+MERN refers to MongoDB, Express.js, ReactJS, and Node.js, four software tools that cooperate to power millions of websites worldwide. In broad terms:
+
+- [**MongoDB**](/docs/guides/databases/mongodb/) manages data, such as customer information, technical measurements, and event records.
+- [**Express.js**](/docs/guides/express-js-tutorial/) is a web application framework for the "behaviors" of particular applications. For example, how data flows from catalog to shopping cart.
+- [**ReactJS**](/docs/guides/development/react/) is a library of user-interface components for managing the visual "state" of a web application.
+- [**Node.js**](/docs/guides/development/nodejs/) is a back-end runtime environment for the server side of a web application.
+
+Linode has [many articles](/docs/guides/) on each of these topics and supports thousands of [Linode customers who have created successful applications](https://www.linode.com/content-type/spotlights/) based on these tools.
+
+One of MERN’s important distinctions is the [JavaScript programming language is used throughout](https://javascript.plainenglish.io/why-mern-stack-is-becoming-popular-lets-see-in-detail-8825fd3fd5ee) the entire stack. Certain competing stacks use PHP or Python on the back end, JavaScript on the front end, and perhaps SQL for data storage. MERN developers focus on just a single programming language, [JavaScript, with all the economies](https://javascript.plainenglish.io/should-you-use-javascript-for-everything-f98015ade40a) that implies, for training and tooling.
+
+## Install the MERN stack
+
+You can install a basic MERN stack on a 64-bit x86_64 [Linode Ubuntu 20.04 host](https://www.linode.com/distributions/) in under half an hour. As of this writing, parts of MERN for Ubuntu 22.04 remain experimental. While thousands of variations are possible, this section typifies a correct "on-boarding" sequence. The emphasis here is on "correct", as scores of already-published tutorials embed enough subtle errors to block their use by readers starting from scratch.
+
+### Install MongoDB
+
+1. Update the repository cache using the following command:
+
+ ```command
+ apt update -y
+ ```
+
+1. Install the networking and service dependencies Mongo requires using the following command:
+
+ ```command
+ apt install ca-certificates curl gnupg2 systemctl wget -y
+ ```
+
+1. Import the GPG key for MongoDB.
+
+ ```command
+ wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
+ ```
+
+1. Add the MongoDB package list to APT.
+
+ {{< tabs >}}
+ {{< tab "Debian 10 (Buster)" >}}
+ ```command
+ echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
+ ```
+ {{< /tab >}}
+ {{< tab "Ubuntu 20.04 (Focal)" >}}
+ ```command
+ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
+ ```
+ {{< /tab >}}
+ {{< /tabs >}}
+
+1. Update the APT package index using the following command:
+
+ ```command
+ sudo apt update
+ ```
+
+1. Install MongoDB using the following command:
+
+ ```command
+ sudo apt install mongodb-org
+ ```
+
+See the official documentation for more on installing MongoDB [on Debian](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/) and [on Ubuntu](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/). You can also refer to our guide [How To Install MongoDB on Ubuntu 16.04](/docs/guides/install-mongodb-on-ubuntu-16-04/).
+
+#### Start MongoDB and Verify the Installation
+
+Once MongoDB has been installed, enable and start the service. You can optionally test MongoDB to verify that it has been installed correctly.
+
+1. Enable the MongoDB service using the following command:
+
+ ```command
+ systemctl enable mongod
+ ```
+
+1. Launch the MongoDB service using the following command:
+
+ ```command
+ systemctl start mongod
+ ```
+
+1. Verify the MongoDB service using the following command:
+
+ ```command
+ systemctl status mongod
+ ```
+
+ You should see diagnostic information that concludes the MongoDB database server has started.
+
+ ```output
+ … Started MongoDB Database Server.
+ ```
+
+1. For an even stronger confirmation that the Mongo server is ready for useful action, connect directly to it and issue the following command:
+
+ ```command
+ mongo
+ ```
+
+1. Now issue the following command:
+
+ ```command
+ db.runCommand({ connectionStatus: 1 })
+ ```
+
+ You should see, along with many other details, the following summary of the connection status:
+
+ ```output
+ … MongoDB server … "ok" : 1 …
+ ```
+
+1. Exit Mongo using the following command:
+
+ ```command
+ exit
+ ```
+
+### Install Node.js
+
+While the acronym is MERN, the true order of its dependencies is better written as "MNRE". ReactJS and Express.js conventionally require Node.js, so the next installation steps focus on Node.js. As with MongoDB, Node.js's main trusted repository is not available in the main Ubuntu repository.
+
+1. Install the Node Version Manager, the preferred method for installing Node.js using the following command:
+
+ ```command
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
+ ```
+
+1. Restart your shell session (logging out and logging back in), or run the following command:
+
+ ```command
+ export NVM_DIR="$HOME/.nvm"
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
+ ```
+
+1. Install the current version of Node.js using the following command:
+
+ ```command
+ nvm install node
+ ```
+
+1. If you are deploying an existing project that uses the Yarn package manager instead of NPM, you need to install Yarn as well. You can do so with the following command:
+
+ ```command
+ npm install -g yarn
+ ```
+
+You can additionally refer to our [How to Install and Use the Node Package Manager (NPM) on Linux](/docs/guides/install-and-use-npm-on-linux/#how-to-install-or-update-npm) guide. If you are interested in using Yarn instead of NPM, take a look at our [How to Install and Use the Yarn Package Manager](/docs/guides/install-and-use-the-yarn-package-manager/) guide.
+
+### Install React.js
+
+Install React.js using the following commands:
+
+```command
+mkdir demonstration; cd demonstration
+npx --yes create-react-app frontend
+cd frontend
+npm run build
+```
+
+Templates for all the HTML, CSS, and JS for your model application are now present in the `demonstration/frontend` directory.
+
+### Install Express.js
+
+Express.js is the final component of the basic MERN stack. Install it using the following commands:
+
+```command
+cd ..; mkdir server; cd server
+npm init -y
+cd ..
+npm install cors express mongodb mongoose nodemon
+```
+## Use the MERN Stack to Create an Example Application
+
+The essence of a web application is to respond to a request from a web browser with an appropriate result, backed by a datastore that "remembers" crucial information from one session to the next. Any realistic full-scale application involves account management, database backup, context dependence, and other refinements. Rather than risk the distraction and loss of focus these details introduce, this section illustrates the simplest possible use of MERN to implement a [three-tier operation](https://www.ibm.com/cloud/learn/three-tier-architecture) typical of real-world applications.
+
+"Three-tier" in this context refers to the teamwork web applications embody between:
+
+- The presentation in the web browser of the state of an application
+- The "back end" of the application which realizes that state
+- The datastore which supports the back end beyond a single session of the front end or even the restart of the back end.
+
+You can create a tiny application that receives a request from a web browser, creates a database record based on that request, and responds to the request. The record is visible within the Mongo datastore.
+
+### Initial Configuration of the MERN Application
+
+1. Create `demonstration/server/index.js` with the following content:
+
+ ```file {title="demonstration/server/index.js" lang="javascript"}
+ const express = require('express');
+ const bodyParser = require('body-parser');
+ const mongoose = require('mongoose');
+ const routes = require('../routes/api');
+ const app = express();
+ const port = 4200;
+
+ // Connect to the database
+ mongoose
+ .connect('mongodb://127.0.0.1:27017/', { useNewUrlParser: true })
+ .then(() => console.log(`Database connected successfully`))
+ .catch((err) => console.log(err));
+
+ // Override mongoose's deprecated Promise with Node's Promise.
+ mongoose.Promise = global.Promise;
+ app.use((req, res, next) => {
+ res.header('Access-Control-Allow-Origin', '*');
+ res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
+ next();
+ });
+ app.use(bodyParser.json());
+ app.use('/api', routes);
+ app.use((err, req, res, next) => {
+ console.log(err);
+ next();
+ });
+
+ app.listen(port, () => {
+ console.log(`Server runs on port ${port}.`);
+ });
+ ```
+
+1. Create `demonstration/routes/api.js` with the following content:
+
+ ```file {title="demonstration/routes/api.js" lang="javascript"}
+ const express = require('express');
+ const router = express.Router();
+
+ var MongoClient = require('mongodb').MongoClient;
+ var url = 'mongodb://127.0.0.1:27017/';
+ const mongoose = require('mongoose');
+ var db = mongoose.connection;
+
+ router.get('/record', (req, res, next) => {
+ item = req.query.item;
+ MongoClient.connect(url, function(err, db) {
+ if (err) throw err;
+ var dbo = db.db("mydb");
+ var myobj = { name: item };
+ dbo.collection("demonstration").insertOne(myobj, function(err, res) {
+ if (err) throw err;
+ console.log(`One item (${item}) inserted.`);
+ db.close();
+ })
+ });
+ })
+ module.exports = router;
+ ```
+
+1. Create `demonstration/server/server.js` with the following content:
+
+ ```file {title="demonstration/server/server.js" lang="javascript"}
+ const express = require("express");
+ const app = express();
+ const cors = require("cors");
+ require("dotenv").config({ path: "./config.env" });
+ const port = process.env.PORT || 4200;
+ app.use(cors());
+ app.use(express.json());
+ app.use(require("./routes/record"));
+ const dbo = require("./db/conn");
+
+ app.listen(port, () => {
+ // Connect on start.
+ dbo.connectToServer(function (err) {
+ if (err) console.error(err);
+ });
+ console.log(`Server is running on port: ${port}`);
+ });
+ ```
+
+### Verify Your Application
+
+1. Launch the application server using the following command:
+
+ ```command
+ node server/index.js
+ ```
+
+1. In a convenient Web browser, request the URL, ``localhost:4200/api/record?item=this-new-item``
+
+ At this point, your terminal should display the following output:
+
+ ```output
+ One item (this-new-item) inserted.
+ ```
+
+1. Now launch an interactive shell to connect to the MongoDB datastore using the following command:
+
+ ```command
+ mongo
+ ```
+
+1. Within the MongoDB shell, request:
+
+ use mydb
+ db.demonstration.find({})
+
+ Mongo should report that it finds a record:
+
+ {{< output >}}{ "_id" : ObjectId("62c84fe504d6ca2aa325c36b"), "name" : "this-new-item" }{{< /output >}}
+
+This demonstrates a minimal MERN action:
+- The web browser issues a request with particular data.
+- The React frontend framework routes that request.
+- The Express application server receives the data from the request, and acts on the MongoDB datastore.
+
+## Conclusion
+
+You now know how to install each of the basic components of the MERN stack on a standard Ubuntu 20.04 server, and team them together to demonstrate a possible MERN action: creation of one database record based on a browser request.
+
+Any real-world application involves considerably more configuration and source files. MERN enjoys abundant tooling to make the database and web connections more secure, to validate data systematically, to structure a [complete Application Programming Interface](https://www.mongodb.com/blog/post/the-modern-application-stack-part-3-building-a-rest-api-using-expressjs) (API), and to simplify debugging. Nearly all practical applications need to create records, update, delete, and list them. All these other refinements and extensions use the elements already present in the workflow above. You can build everything your full application needs from this starting point.
\ No newline at end of file