If you are using Cloudways, you already know that there is no direct access to files through the hosting panel. However, you can use the File Manager Plugin to get access. But if you are migrating your site, or restoring a site, you need to access files in the backend. Below we have discussed all the ways to access your files in the Cloudways Server.
The File Manager Plugin method works only when you have access to your WordPress Dashboard. Sometimes, due to reasons, we don’t get access and we need to find other methods to deal with our files.
We at WP Climax, have hosted some of our/client sites on Cloudways Servers and we use all the below methods for specific purposes which are mentioned below.
Table of Contents
File Manager Plugin
If you want to edit your .htaccess, wp-config.php. add/ remove files and folders, this File Manager Plugin is the one that you should be using. Each and every time we cannot rely on the SFTP method for minor changes which consumes more time. Assume, if you wanted to edit your ‘.htaccess‘, if you use File Zilla, you have to first download the file, make changes through your PC and then you will reupload the file.
If you use the File Manager plugin, you can save your time with all these hassles. Now, what if your WordPress itself is not accessible? And what if you are Migrating/ Restoring your site? You don’t have access to the plugin right? In this case, you must follow the FTP method. In the case of Cloudways, we will use SFTP instead.
File Zilla SFTP Method
The best way to connect your Cloudways to FileZilla is through Server Credentials. This gives you access to all applications inside that server. If you are providing access to your client, you will provide them with Application Level Credentials and NOT Server Level.
First, install File Zilla for your PC and add a New Site. Select the SFTP type in the Protocol dropdown. It will ask you for some information. You will find all the necessary login credentials on the Cloudways panel itself. Below is the screenshot of FileZilla.
The Host is your IP address and the Port Number is 22 for SFTP. The Username and Password will be mentioned in the Server Information in the Cloudways Panel as shown below.
While connecting, FileZilla may prompt you to trust this connection. Once connected to the IP, you will see the below screen. All your WordPress application files will be stored in the Application Folder as highlighted in the below image.
The advantage of using SFTP for Cloudways is that you are in full control of your hosting files. You can add or remove folders. Upload new files and delete individual files on your hosting.
Mild Warning: You will only make changes inside of ‘public_html‘ root directory of your website. Let the other files on the hosting be untouched.
Now comes the disadvantage of using FileZilla. When you are migrating/ restoring your site, you need to empty the public_html folder of your WordPress installation. In this case, you can use FileZilla. But that takes a lot of time. Maybe around 20 minutes or so.
And that is why we follow the SSH method for erasing our ‘public_html‘ drive. The process is instant and below is how you do it. It all takes less than 2 minutes.
The benefit of using Cloudways is that they have provided an SSH terminal launcher within the control panel itself. In the case of other custom servers, we need to launch SSH through external applications (like Putty) from our PCs.
From the Cloudways Dashboard, on the same page where you received your SFTP Credentials, there is an option to Launch the SSH terminal. Click on that. This will open up a new window.
The connection will be shown as insecure by web browsers. You can continue by clicking on advanced options or by typing ‘thisisunsafe‘. There shouldn’t be any spaces between words, the same way you used to enter cheat codes in GTA vice city 🙂
In the login screen, it will ask you for the username first and then the password. In order to copy the username, go back to the panel and copy with a single click.
Go back to the terminal. Right-click and select paste from browser. Paste the username into the browser and select OK. Do not forget to press Enter. If you don’t press Enter, nothing will happen.
Similarly, enter the password the same way you pasted the username. Once pressed Enter, the panel will log you in. (You cannot see the password you pasted. It will be invisible for security reasons).
For our purpose we use only 3 commands in order to get our job done i.e, to remove contents within the public_html folder. There are multiple SSH commands that you can learn to improve your skills. Below are the 3 commands that we use.
ls – Listing Directory Contents.
cd– Go to a Specific Directory.
rm -rf *– Command to format the folder without removing the folder.
Once you Login to your server through SSH, follow the below commands as mentioned in the below screenshot. Our job below is to access the public_html folder and to delete its contents.
We will first use the ‘ls‘ command to list the contents in our server. It will display the folder ‘applications‘. The other folders are hidden from user access (which start from dot ‘.’)
Now we will enter the applications folder with ‘cd applications‘ command.
Once inside the ‘applications’ directory, we will list the contents inside by using the ‘ls‘ command again.
The terminal will show us all the folders. The number of folders shown depends on the number of WordPress installations. In our case, we had 3 WordPress installations, the one marked with the color ‘pink‘ is the one we are dealing with here.
Just like we entered the folder applications with ‘cd‘ command, we will enter the folder of our WordPress installation. Make sure that you enter the right one. Here is how you find the right one.
First, visit the ‘applications‘ on the Cloudways server. In the application’s details, you will see the name of the database. The name of the database is itself the name of the folder.
Once you know the name of the right WordPress folder to deal with, enter the command ‘cd‘ followed by the folder name as in the above screenshot.
Once you have entered the right folder. You will list its contents with the ‘ls‘ command. The terminal will list all the contents in the wordpress application folder.
Now we will enter the ‘public_html’ folder by using the same previous command ‘cd‘ followed by the folder name. i.e, ‘cd public_html‘
You can also use the command ‘ls‘ to list its contents. But that’s not necessary. We will just format our folder with a single command.
Warning: There is no going back once you press Enter followed by the ‘remove‘ command. The whole directory will be erased in our case. Make sure you are doing the right thing.
Once you are inside the ‘public_html‘ folder, use the command ‘rm -rf *’. The moment you press Enter, the folder will be formatted instantly. If you want to confirm, use the ‘ls’ command. You will not see any files inside.
Once done, exit the terminal by ‘exit‘ command and you will be logged out.
We at WP Climax utilize all the above methods to manage our and client sites on Cloudways. If this tutorial was helpful, let us know in the comments below. If you have any questions, we would definitely like to answer them.