Surge deployments in 2 minutes


# install with npm
npm install --global surge

# OR install with yarn
yarn global add surge

# run
  • Enter an email and password to signup or login
  • Select a directory to publish
  • Enter a domain name
  • Done!


If you’re already authenticated, you can directly pass in the directory with the surge command

# deploy a directory
surge /public
# deploy folder while passing the domain name as parameter
surge public/ --domain 

save your domain name to a CNAME file

You can pass the domain name as a CLI parameter

surge --domain

Or you can save it as a CNAME file

echo > CNAME

When developing with Gastby, the CNAME file needs to be in the root directory or in the static folder so that it gets copied to your public folder upon build.

using a custom domain

Point your domain to or

# with a CNAME record (@, www)
# with an A/AAA record (*)
# deploy to your custom domain
surge path-to-project/

# save custom domain name to avoid entering it every time
echo > CNAME