How to deploy a website in few minutes with Surge.sh for free

higormarques

Higor Neves Marques

Posted on January 9, 2020

How to deploy a website in few minutes with Surge.sh for free

How many times do you feel discouraged to build some simple apps or code for fun because the deploy is harder to config than build the app?

So, some years ago I found a great solution for that: Surge.sh.

Surge is a very, very simple way to deploy your website/web app in a few minutes with node.js. Let see how:

To install Surge, just run:
npm install --global surge

After, go to your project root, run surge and fill the project (project path) and domain fields:

$surge

   project: ~/Jane/Desktop/my-project/
   domain: my-project.surge.sh
   upload: [============]

Success! Published and running at my-project.surge.sh

Deploying to a custom domain

Surge offer options to deploy your project to a custom domain passing it as the second parameter:

$surge ./ *mycustondomain.com*

The first parameter is the project path, in this case, since I'm at the project root folder I passed the ./. As second parameter my custom domain.

IMPORTANT: You may need to configure your DNS with a CNAME or A registry pointing to DOMAIN ou IP provided by Surge. For more details, you can read the complete guide made by the Surge team here.

Conclusion

I bet you this is one of the easiest ways to deploy websites o have seen, right? hehe

Surge also has paid plans for professional projects with some perks like force HTTP to HTTPS, custom SSL, unlimited domains, custom redirects... just for $30/mo.

Thanks for reading ;)

💖 💪 🙅 🚩
higormarques
Higor Neves Marques

Posted on January 9, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related