When creating your website, you will often need to create additional page files. These may be display file such as html or php, or text files used for reference or configuration.
Although a popular method is to create the folder on your local machine and upload the file to your hosting account, you can also use your File manager or FTP client to log into the account and create the file directly on the server. Below are instructions for simply creating a new file using the cPanel File Manager, the Filezilla FTP client, and the NotePad++ file editor.
- Which Option Should I Choose?
- Using the cPanel File Manager
- Using FileZilla FTP Client
- Using NotePad++ File Editor
- Using Command Line Interface (CLI)
Which Option Should I Choose?
If you are brand new to website building, you may not have the Filezilla or Notepad++ software on your computer so the cPanel may be the way to go. Using the cPanel File Manger requires no additional download or configuration, however the FTP and Notepad++ software is better overall as you gain more experience and work with more than one file at a time.
Using the cPanel File Manager
- Log into the cPanel
- Click the File Manager button, then navigate to the folder where you want to create the file.
- Click the +File icon found in the top-left of the toolbar.
- After clicking the icon, a popup box will appear for you to name the file. For our example, we name the file test.html. Click on the Create New File button once you name the file.
Using Filezilla FTP client
- Open your Filezilla FTP program and connect to your hosting account.
- Navigate to the correct folder in the right hand panel. If you are unsure which folder you should be in, use this article to help you decide.
- Using the lower-most right hand panel, right-click anywhere in the whitespace and a popup menu will appear. Select the Create New File option.
- This brings a popup where you will need to name the file. After naming your file, click on the OK button to save it on the server.
Using NotePad++ File Editor
- Open your NotePad++ program in your desktop.
- Connect to the server using FTP function.
- Right click in whitespace of the upper FTP panel and click on the Create New File option.
- You will be prompted to name the file with a popup. Name the file and click on the OK button to save it.
Using Command Line Interface (CLI)
There are many ways to create a file using the Linux command line, but the touch command is one of the easiest.
- Connect to your server via SSH.
- Navigate to the folder location you want to create the file in.
- You can then create a file using the touch command.
- If you want to verify the file was created, use the “ls -l” command or simply “ll”.
You will then see your files in a long list and should see your new file included.
- You can then open the file using your preferred editor such as Emacs, Vim, or Nano. Here is an example of using Nano:
Congratulations! You have just created a new file! Obviously, these steps only created a blank file. You may want to check out our article on how to edit a file so you can add some content to your website.