Skip to content

Deploy Files to Server

Video Lecture

Deploy Files to the Server Deploy Files to the Server

 (Pay Per View)

You can use PayPal to purchase a one time viewing of this video for $1.49 USD.

Pay Per View Terms

  • One viewing session of this video will cost the equivalent of $1.49 USD in your currency.
  • After successful purchase, the video will automatically start playing.
  • You can pause, replay and go fullscreen as many times as needed in one single session for up to an hour.
  • Do not refresh the browser since it will invalidate the session.
  • If you want longer-term access to all videos, consider purchasing full access through Udemy or YouTube Memberships instead.
  • This Pay Per View option does not permit downloading this video for later viewing or sharing.
  • All videos are Copyright © 2019-2025 Sean Bradley, all rights reserved.

Description

Now to upload the contents of our ./dist folder to our server using Secure File Transfer Protocol (SFTP).

On windows, you can use WinSCP

Download it from https://winscp.net/eng/index.php and install it.

Add your servers configuration and then connect.

Using the WinSCP explorer interface, navigate to the /var/www/ folder on your server.

Then create another folder named my-project.

Now copy your complete ./dist folder into your new my-project folder.

SSH back onto your server and cd into the /etc/nginx/sites-enabled folder.

#
cd /etc/nginx/sites-enabled

View the contents of the folder.

#
ls

We can delete the default config.

#
rm default

We will create a new config that will serve the contents of our my-project folder.

#
nano my-project

And copy/paste this code belowe into the editor.

server {
       listen 80;
       listen [::]:80;

       root /var/www/my-project;
       index index.html;

       location / {
               try_files $uri $uri/ =404;
       }
}

Press CTRL X and then press Y to save the buffer and exit.

Test that the Nginx config syntax is OK.

#
nginx -t

If it is OK, then restart Nginx.

#
service nginx restart

And check its status.

#
service nginx restart

Now visit your IP address in your browser.

Visit http://[your ip address]

You should see your web application that was just uploaded.