Remembering a domain

By default, Surge will prompt you for a domain each time you deploy. To skip this, you can pass it into the CLI when you run the surge command. For example, if your subdomain was vancouver.surge.sh, you could run the following command:

surge --domain vancouver.surge.sh

Saving your domain to a CNAME file

You can also save your domain to a CNAME file so you don’t have to type it into the CLI either. Add a CNAME file (no extension) to the root of the project you’re deploying, and Surge will use that automatically.

You can create a new CNAME file in your text editor of choice:

You may also do it directly from the CLI using the following command:

echo vancouver.surge.sh > CNAME

…replacing vancouver.surge.sh with your own domain or subdomain.

Adding a `CNAME` file using the command line. You could also create this file in your prefered text editor.