How to Deploy a Website: previev your site locally

Hello everyone,

I am doing the Deploy a Website course (the link is under this):
https://www.codecademy.com/courses/deploy-a-website/lessons/create-static-site/exercises/local-preview

The first question in Preview Your Site Locally it states: “To view your site locally, you must first navigate to your site’s directory, using the cd command. Navigate to your site’s directory using the cd command.”

How can I do this?

Hi melange15,

The cd command is used to ‘change directory’ into a folder, in this case to wherever your site is located. It’s a bit like a text-based version of File Explorer.

If you are a Linux user you can open the terminal (one method is to right-click on the desktop and select ‘Open Terminal Here’) and use the cd command to locate to where the file is on your computer.

If you’re using a Windows device, you can use a shell such as Command Prompt (default for Windows). This can be opened by searching for ‘Command Prompt’ in the taskbar. You can then use the cd command to move to the folder where your site is located.

The command (at a basic level) works the same way for both operating systems. For example:

cd /path/to/site/

Once you are within the directory, you can continue following the instructions to preview your site.

Codecademy has a ‘Learn the Command Line’ course which contains more on using the Command-Line.

I hope that helps.

1 Like