Lesson 4: Detailed File Management Using cPanel & FTP
1. Managing Files via File Manager
The "File Manager" in cPanel provides a graphical interface to easily manage your website files and folders. Below is a detailed explanation of its features:
- Opening File Manager:
From the cPanel home page, click on the "File Manager" icon.
- Navigating Directories:
When File Manager opens, you will see the directory structure. The main folder is "public_html", which contains your website files.
- Uploading Files:
Click the "Upload" button to select and upload files from your computer to the desired directory.
- Changing File Permissions:
To change file permissions, right-click the file and select "Change Permissions". Permissions are represented numerically (e.g., 755 for folders and 644 for files) to control who can read, write, and execute the file.
- Compressing Files:
To compress files (group multiple files or reduce size), right-click the file or folder and select "Compress", then choose a compression format (such as ZIP).
- Extracting Files:
If you have a compressed file, right-click it and select "Extract" to decompress it into the specified folder.
- Editing Files:
To edit a text file (HTML, PHP, etc.), right-click the file and select "Edit" to open the built-in text editor, make your changes, and then save the file.
- Renaming or Moving Files:
You can rename or move files between folders by right-clicking and selecting "Rename" or "Move".
2. Managing Files via FTP
FTP provides a method to transfer files between your computer and the hosting server. Follow these steps to manage files using FTP:
- Creating an FTP Account:
In cPanel, navigate to the "FTP Accounts" section and create a new FTP account with a unique username and password.
- Setting Up an FTP Client:
Download an FTP client like FileZilla. After installation, enter your connection details such as "Server Address", "Username", "Password", and the port (usually 21).
- Transferring Files:
Once connected, you can drag and drop files between your computer and the server to upload or download as needed.
- Changing File Permissions via FTP:
Most FTP clients allow you to change file permissions by right-clicking a file and selecting "File Permissions", then adjusting the numeric values.
- Note on Compression:
FTP does not typically offer built-in tools for compressing or decompressing files; it is recommended to use File Manager for those tasks.
3. Additional Tips and Best Practices
- Always back up your website files before making significant changes.
- Ensure proper file permissions for security (e.g., folders: 755, files: 644).
- Use file compression when transferring multiple files to save time and bandwidth.
- Utilize reliable text editors and avoid modifying critical parts of your code unnecessarily.
This lesson has provided a detailed guide on managing your website files using both cPanel’s File Manager and FTP – including how to change permissions, compress/decompress files, and edit them.
