Deploying your files to the server on Save

Once you have your files ready to share with the world, your next step is to deploy them, which is a fancy way of saying “lets save these files on a server so other people can access them”. Here I’ll go through a few different options of accomplishing …


This content originally appeared on DEV Community and was authored by Luis Juarez

Once you have your files ready to share with the world, your next step is to deploy them, which is a fancy way of saying "lets save these files on a server so other people can access them". Here I'll go through a few different options of accomplishing this:

Uploading the file to the server using cPanel

The most common way for new web developers to push their files to the server is using the file manager built into cPanel. This allows you to select which files to upload. While this is reliable, it's a very manual process to upload new files or overwrite files when something changes.

FTP

FTP stands for File Transfer Protocol, and it is a way for your computer to make a connection to the server, allowing you to upload, overwrite, and delete files on a remote server. For all the below methods, you will first want to setup an FTP login in your cPanel by going to Files -> FTP Accounts. Create a new FTP account and store the username and password, you will need these to setup the FTP client below.

FTP using PHPStorm

In PHPStorm, under Preferences -> Deployment -> Add, you can setup an FTP connection to the server.

  • For type you can use FTP

  • Host should be your domain name, port 21

  • Enter the username and password you setup on cPanel
    Next, under the Mappings tab, you can setup the local path and deployment path. If you want files uploaded to the root of your server, you can just use "/" for Deployment path.
    If you are working on a subfolder of your website (like mywebsiteblog.com/blog) then you can set the deployment path for /blog to have all the files in your folder pushed to that subfolder.

  • Back to PHPStorm Preferences -> Deployment -> Options, I like to set the Upload changed files automatically to the server to "On Explicit Save", which gives you the Save to deploy functionality.

FTP using FileZilla/CyberDuck

An honorable mention here, these FTP clients allow you to more easily sync files between the server and your computer than the cPanel file manager, but still take some manual work.

SSH

The modern more secure way to connect to a server, there is a solid tutorial for setting up SSH here

Using Git

New platforms like Vercel and Netlify allow you to select a git repository, and whenever a commit is pushed to the main branch, it automatically builds the new files, then copies the build folder to the server.


This content originally appeared on DEV Community and was authored by Luis Juarez


Print Share Comment Cite Upload Translate Updates
APA

Luis Juarez | Sciencx (2022-02-03T19:22:21+00:00) Deploying your files to the server on Save. Retrieved from https://www.scien.cx/2022/02/03/deploying-your-files-to-the-server-on-save/

MLA
" » Deploying your files to the server on Save." Luis Juarez | Sciencx - Thursday February 3, 2022, https://www.scien.cx/2022/02/03/deploying-your-files-to-the-server-on-save/
HARVARD
Luis Juarez | Sciencx Thursday February 3, 2022 » Deploying your files to the server on Save., viewed ,<https://www.scien.cx/2022/02/03/deploying-your-files-to-the-server-on-save/>
VANCOUVER
Luis Juarez | Sciencx - » Deploying your files to the server on Save. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/03/deploying-your-files-to-the-server-on-save/
CHICAGO
" » Deploying your files to the server on Save." Luis Juarez | Sciencx - Accessed . https://www.scien.cx/2022/02/03/deploying-your-files-to-the-server-on-save/
IEEE
" » Deploying your files to the server on Save." Luis Juarez | Sciencx [Online]. Available: https://www.scien.cx/2022/02/03/deploying-your-files-to-the-server-on-save/. [Accessed: ]
rf:citation
» Deploying your files to the server on Save | Luis Juarez | Sciencx | https://www.scien.cx/2022/02/03/deploying-your-files-to-the-server-on-save/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.