Basic SSH Server commands for the everyday Entrepreneur

ssh_lioneur

If you like buying code and playing around with software, then you need to know how to install PHP scripts. Bellow is simple commands to get around your server and do the very basics.

All my servers are hosted on Cloudways, they are by far the best hosting platform for entrepreneurs. I am going to simulate a scenario of how to install a script on Cloudways. I will assume that you already have a server running and SFTP is set up.

This is also the faster way to upload your script to your server. The alternative is to unzip your files on your local disk and upload the files to your server, but this takes longer.

Step 1:

Make sure your PHP script is zipped. Usually when your download files from Codecanyon it comes with documentation included in the package. Do not upload document files to your server.

Step 2:

Upload your zipped file to the “public_html” directory that is located on your server. The SFTP details are located on your Cloudways application. “ACCESS DETAILS->Application Credentials”

Step 3:

Now login to your Server via SSH. You can log in via the browser or use putty. When you decide to login via Cloudways, you can do so by clicking on your server and clicking on “Launch SSH Terminal”. NOTE this is on your server and not the application.

Insert your username and password. - details are on the first page of your server dashboard.

cd applications - go to the directory "applications"

ls - "look at all the applications"

cd your_application_name - Easiest way to find this is to look at you database name under your application dashboard.

cd public_html - This is where you uploaded your zip file.

ls - Look at all the files. Only your zip file and index.php must be located in this directory.

rm index.php - Remove the default index.php file.

unzip script.zip - Replace "Script" with the name of your zip file.  

When done unzipping type "ls" to list all the files.

mv script/* . - If your files are zipped into a folder, you can use this command to copy everything into the public_html directory.

rm script.zip - Remove the zipped file

rm -rf script - If you moved all the files out of this folder, then it is sopposed to be empty and you can remove the empty folder.

I know this is a lot of technical details but doing it a few times will make it easier for you. Please remember this is the setup for Cloudways, your hosting provider may look different. I also don’t think it will work on shared hosting.

If you have any questions, please contact me.clo