Build a Simple dApp in 3 Minutes - Setup (Part 1)
Build Your First Moralis dApp! This Guide Series Covers the Basics and How to Get Started Fast. Part One Covers Server Setup.
It goes so fast to build on Moralis. In this guide, we'll show you how easy it is to get a simple dApp up and running. Are you ready? Go...!

Create a Free Moralis Account

Go to Moralis and register a free account.

Create a New Moralis Server

Pick a cool name, select the region closest to you, then choose "Mainnet" for Network.
This will take a couple of minutes to spin up. While that's working, let's start coding!

Include Moralis on Your HTML Page

In order to communicate with the Moralis Server, we need to include the Moralis code in our dApp. Open your favorite text editor. We recommend Visual Studio Code with the "Live Server" extension to make running the web page super easy.
Create a new file called index.html and copy the following code.
1
<html>
2
<head>
3
<!-- Moralis SDK code -->
4
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>
5
<script src="https://unpkg.com/moralis/dist/moralis.js"></script>
6
</head>
7
<body>
8
<h1>Gas Stats With Moralis</h1>
9
​
10
<button id="btn-login">Moralis Login</button>
11
<button id="btn-logout">Logout</button>
12
​
13
<script>
14
// connect to Moralis server
15
Moralis.initialize("paste Moralis APP ID here");
16
Moralis.serverURL = "paste Morlis server URL here";
17
</script>
18
</body>
19
</html>
Copied!

Copy Moralis Server URL and Application ID

Once the server instance has been created, find your Moralis server URL and application ID and paste them into the <script> tag where indicated.
Click the "View Details" button
Paste URL and ID into your HTML file where indicated.

Congratulations, You Made It!

Your server is up and running. Keep going! Next up is part two where we learn how to log in with MetaMask.
​
Last modified 1mo ago