How to Deploy Your First Website with Netlify or Vercel

Likhith SPLikhith SP
4 min read

Introduction

Building your website is an exciting milestone, but the real magic happens when you deploy it live for the world to see. Deploying a website used to be a complex process, involving servers and a lot of configuration. Luckily, platforms like Netlify and Vercel have made it incredibly easy to get your site online with just a few clicks.

In this guide, I’ll walk you through how to deploy your first website using either Netlify or Vercel, two of the most popular platforms for modern web hosting.

Why Choose Netlify or Vercel?

Both Netlify and Vercel are designed for JAMstack (JavaScript, APIs, and Markup) websites, offering features like continuous deployment, custom domains, and serverless functions. Here’s why they stand out:

  • Netlify:

  • Great for static websites.

  • Easy drag-and-drop deployments.

  • Built-in CI/CD (Continuous Integration/Continuous Deployment).

  • Free tier includes SSL, custom domains, and 100GB bandwidth.

  • Vercel:

  • Excellent for Next.js and other React-based frameworks.

  • Simple integration with GitHub, GitLab, and Bitbucket.

  • Automatic server-side rendering (SSR) and static generation.

  • Free tier includes SSL, global CDN, and custom domains.

Prerequisites

Before you get started, make sure you have the following:

  1. A GitHub, GitLab, or Bitbucket account: Both platforms allow seamless integration with your Git repository.

  2. A completed website: Whether it’s built with HTML, CSS, JavaScript, or a static site generator like Gatsby or Next.js.

  3. A Git repository: Your website code should be committed and pushed to a repository on GitHub, GitLab, or Bitbucket.

How to Deploy Your Website on Netlify

Let’s start with Netlify, which is known for its simplicity and ease of use.

Step 1: Create a Netlify Account

  1. Visit the Netlify website.

  2. Sign up with your GitHub, GitLab, or Bitbucket account.

  1. Once logged in, click on “New site from Git” on the dashboard.

  2. Choose the platform where your code is hosted (e.g., GitHub).

  3. Select the repository that contains your website’s code.

  4. Choose the branch you want to deploy (usually main or master).

Step 3: Configure Build Settings

If your website is static (e.g., built with plain HTML, CSS, and JavaScript), you may not need a build command. If you’re using a static site generator (e.g., Gatsby, Hugo), enter the build command in this section.

  • Build Command: If applicable, specify the command that builds your site (e.g., gatsby build, npm run build).

  • Publish Directory: Enter the directory where your website files are generated (e.g., public, dist).

Step 4: Deploy Your Website

  1. Click Deploy site.

  2. Netlify will start building and deploying your site. In a few moments, you’ll see your website live with a default Netlify subdomain like your-site-name.netlify.app.

Step 5: Add a Custom Domain (Optional)

If you own a custom domain, you can add it to your Netlify site:

  1. Go to Domain settings in your site dashboard.

  2. Click on “Add custom domain” and follow the prompts to link your domain to Netlify.

How to Deploy Your Website on Vercel

Next, let’s deploy your website using Vercel, which is ideal for React-based applications like Next.js.

Step 1: Create a Vercel Account

  1. Go to Vercel’s website.

  2. Sign up using your GitHub, GitLab, or Bitbucket account.

Step 2: Import Your Git Repository

  1. After logging in, click on “New Project”.

  2. Select the Git repository containing your website code.

  3. Vercel will automatically detect the framework you’re using (Next.js, Gatsby, etc.) and configure the necessary settings.

Step 3: Configure Project Settings

If you’re using a static site or framework, Vercel will usually auto-detect the build settings. But you can manually specify:

  • Framework Preset: Vercel automatically chooses the framework (Next.js, Create React App, etc.).

  • Build Command: If necessary, specify commands like npm run build or yarn build.

  • Output Directory: Specify where the built files are stored (e.g., .next, out).

Step 4: Deploy Your Website

  1. Click Deploy.

  2. Vercel will build your project and deploy it to a unique Vercel subdomain (e.g., your-site-name.vercel.app).

Step 5: Add a Custom Domain (Optional)

To use your own domain:

  1. Go to the Domains tab in your project dashboard.

  2. Click “Add Domain”, and follow the instructions to link your domain to Vercel.

Conclusion

Deploying a website has never been easier thanks to platforms like Netlify and Vercel. Both options offer robust free tiers and plenty of features to make your website available to the world in just a few minutes. Whether you’re building a simple static site or a more complex web app, you can follow this guide to get your project live with minimal effort.

Now that you’ve deployed your first website, you can share it with friends, colleagues, or users around the globe!
0
Subscribe to my newsletter

Read articles from Likhith SP directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Likhith SP
Likhith SP

My mission is to help beginners in technology by creating easy-to-follow guides that break down complicated operations, installations, and emerging technologies into bite-sized steps.