DEV Community

Cover image for Publish your site assets with the Netlify CLI
Phil Hawksworth for Netlify

Posted on • Edited on • Originally published at netlify.com

1

Publish your site assets with the Netlify CLI

Learn about a different Netlify feature each day throughout December!
Here's one...

Did you know that you can publish your sites to the web without leaving the comfort of your command line?

The open source Netlify CLI includes lots of helpful features (expect to see learn more about that in upcoming post this month!) and deploying production or preview versions of your site can be done with the handy command: netlify deploy

💡 Install the Netlify CLI for all sorts of web development helpers and utilities with this command: npm install -g netlify-cli

The first time you run netlify deploy from a local project folder, it will give you the option of deploying to an existing site or creating a new site in a project team, and then deploy your specified folder to Netlify.

For added safety, the default target for a netlify deploy is a unique preview URL which the CLI helpful returns to you as a link to inspect and share. Ready to deploy to production? Then you’ll want to use the prod flag:

netlify deploy —-prod
Enter fullscreen mode Exit fullscreen mode

More powerful deployment pipelines await you via Netlify’s build infrastructure, but this command is very useful for sending your assets to Netlify where we’ll publish them to the global hosting infrastructure for you.

Happy deploying!

More information

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay