Home / Web Development / Virtualmin / Upload your Website to the VPS with Virtualmin or sFTP

Upload your Website to the VPS with Virtualmin or sFTP

Once you have your VPS setup with Virtualmin and created a virtual server to host a domain name, you need to upload your website to document root of the domain. This tutorial shows you how to upload files to your VPS with FileZilla or Virtualmin’s file manager.

Whether you want to upload a WordPress plugin, theme or even a entire HTML website or landing page, you can use one of following two methods.

  • Using FileZilla over sftp
  • Using Virtualmin file manager

The FileZilla method is easy to execute. While using Virtualmin file manager takes some work if you have sub directories to upload. If you’re coming from shared hosting, you should be familiar with FileZilla already. But I’m going to give you full details anyway.

Do not use your root account to upload files to your VPS. The public_html directory you’re uploading files to is owned by administrative user for your domain, not by the root. If you use root account to upload files, those files will be owned by the root and administrative user won’t have write permission on them. This will cause permission errors on your website.

Method #1: Using FileZilla to Upload Files to the VPS

FileZilla is a FTP client. It can also use to securely transfer files to your VPS over SFTP. It’s a free software. So simply download and install it on your computer. And there are many ftp clients out there. You can use any of them. But I prefer to use Filezilla. If you don’t know how to connect to your server with FileZilla, please refer to FileZilla section of the connecting to your VPS over SSH tutorial or watch the video above.

You’ll be connected to administrative user’s home directory upon successful connection. You’ll find few sub directories inside it. The document root for your domain is public_html directory. Anything you upload here will be publicly available from your domain name. If you already have WordPress or other website hosted on your domain, you see files of that software inside public_html directory.
filezilla-connected-screen

You can now browse files on your computer from the left side window and upload them by right clicking on them. If you want to upload multiple files, you can select them all from the left window and then right click and hit Upload.

It can take a long time if you have large number of files to upload. In that case you can create a zip archive of your files and then use Putty to unzip it after the upload. This will be lot quicker than uploading multiple files.

Method #2: Using Virtualmin file manager to Upload Files to the VPS

Virtualmin has a nice file manager that can be used to manage files on your server. It can also use to upload files to your server. So login to Virtualmin with administrative user and navigate to Webmin Modules > File Manager. You’ll see the home directory of the user.
virtualmin-file-manager

Clicking on public_html will open it. If you already have something hosted on your domain, those files will be listed here. Otherwise it will be an empty directory. Now you can go to File > Upload to current directory from the menu which will open a pop-up. Click the little file pin icon to browse your computer and then hit Upload Files button to upload them.

The problem here is though that Virtulamin can’t create/upload sub directories. Meaning that only files on the current directory will be uploaded and sub-directories will be ignored. As a way around this you can upload your files as a zip archive and then unzip them by login in to server with Putty.

namecheap namecheap

About Tharindu

Profile photo of Tharindu
Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me. send me a message on Fiverr.

Leave a Reply