We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

How to free up space on the VDS / VPS server?

One of the fairly common reasons that lead to server crashes is the lack of free space on it. In this article, we will provide information about what data takes up all the space on the server and whether cleaning is needed.

Why is 100% server space dangerous?

It may seem to many that if there is no need to upload new data to the server, there is no need to have free space on it. But this is far from the case. When there is not enough space on the server (when 100% of 100% is occupied), most of its internal services cease to function normally. The reason for this is the inability to create a temporary file for the service.

The functioning of the server, its services and sites hosted on it directly depends on the ability to work with files. When there is no free space on the server – it will not be possible to make changes to the files, which, in fact, is the reason for disrupting the full operation of the server.

How do I know if my server is out of space?

Main signs / consequences:

  • authorization on the site does not work;

  • adding files to the cart does not work on the site;

  • forms do not work and there is no way to upload a file;

  • session files are not created;

  • the database server is unavailable (the same situation with other services is possible);

  • damaged database tables;

  • have errors stating “disk quota exceeded”, “spaces are not allowed”, or “can not create…" etc.

How to prevent the server from running out of space?

As in other situations, it is better to prevent the problem than to eliminate its consequences. And they, in some cases, can cause serious, often already irreparable damage, which is extremely unpleasant. After all, it is easier to clean up the server from unnecessary files in a timely manner than later, for example, to get corrupted InnoDB tables.

What takes up all the disk space?

If you have already determined that the server is running out of free space – this is already half of solving the problem or preventing the consequences. After that, it is important to figure out what is taking up space on the server and clean it of unnecessary files. And also think about switching from the used tariff, which turned out to be insufficient, to the next one with a large amount of disk space.

What tools will help us find the largest folders and files?


Often, in a situation where the space on the server is completely occupied, there is no way to check it through the control panel, so you need to connect to the server via SSH.


SSH – a network protocol with which you can remotely control a server (operating system). It allows you to access all files under the root user (root password to VPS server sent to the contact mailbox when ordering the service).


First command required: df -h



You need to focus on the / - root section, in the example this is the line:


/dev/vda1        25G   20G  3,9G  84% /


From this information, it can be seen that there are only 25G on the server and from which 20G (84%) is busy and 3.9G is free. The output of the command is rounded to the nearest gigabyte, so the amount of used (25G) and free (3.9G) space may not match the total disk size (25G). All other sections in the example – system virtual partitions.

You can check the size of a file or directory (folder), in the example, the directory / var / log /, using the command:

du -sh /var/log/


With the following set of commands, we can figure out which directories are taking up the most space:

cd /

du -sh * | sort -h


By analogy, you can go to the desired directory and find out the size of directories and files in it:


The following command combination to delete all archives of old server logs:

find /var/log/ -name "*gz"  | xargs -i rm {}

Search for the 10 largest files on the server:

find / -mount -type f -ls 2> /dev/null | sort -rnk7 | head -10 | awk '{printf "%10d MB\t%s\n",($7/1024)/1024,$NF}'

This search can take a long time, and the larger the disk size or the number of files on the server, the longer the search will take.

The command to delete a file or directory:

rm -rf /backup/backup_20_03_2019.tar.gz

Where / backup / backup_20_03_2019.tar.gz is the path to the file we are deleting.

If you find that some kind of log file takes up a lot of space, you need to clean it up, but delete the files into which logs are written – it is impossible. You can clear the file with the command:

> /var/log/nginx/access.log

Where /var/log/nginx/access.log is the path to the file we want to clean up.

Also, it should be understood that the operation of the server completely depends on your actions, so all commands must be followed carefully and files must be deleted only with complete confidence that they are not needed for further work.

Inodes - inodes

For UNIX systems, such a concept as an inode (or simply Inodes) is also relevant. What it is? – in fact, this is the number of files and directories on the server. Inodes can end too. The number of Inodes can be found using the command:

df -i


The output of this command is the same as df -h.

The maximum possible number of Inodes depends on the size of the disk and the file system. As a rule, there are more than enough of them, but sometimes there are cases when Inodes run out faster than disk space. Here are the main reasons for this situation:

  1. Autocleaning of session files of your engine is not configured. Sessions – these are files of almost zero size, but with sufficient traffic to the resource, a lot of them can accumulate.

  2. Website cache files: if a website regularly creates its own cache without deleting the old one, the inode limit may be reached. This is explained by the fact that cache files are a very large number of small files.

  3. Server mail queue: if, for some reason, sending mail on the server does not work, and letters only accumulate in the queue, you may also encounter the Inodes limit. In most cases, the reason for this situation is hacking the server and sending spam from it.

The following two commands will help you find out the number of inodes in use in the current directory and subdirectories:


find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -nr | head -n 10


for i in *; do echo $i; find $i |wc -l; done


With a large disk space or a large number of files, these commands can also take a long time to execute.

Conclusion: after examining this issue in more detail, we see that it is not so difficult to avoid overflowing disk space on the server. Thus, protecting your sites from incorrect work, their temporary unavailability or much more serious problems.

Order hosting and choose a domain in the company "Hosting Ukraine".

We have a high-quality and reliable service, a convenient control system through the admin panel, intelligent security systems and technical support, which will help resolve all emerging issues at any time of the day.

Any tariff of our hosting is suitable for Wordpress. You can choose exactly the package that best suits the needs of your project: SSD hosting, VPS on SSD, Cloud (cloud) hosting, cloud VPS. Dedicated server or dedicated server.

We have developed a system of automatic website testing, this will give you the opportunity to check dozens of indicators and settings of the website and domain. Will check the correctness of the WordPress configuration file, database connection, theme and module settings. Check if the php parameter is configured correctly_memory_limit.

Join Hosting Ukraine and we will take care of the technical side of your business.

Only registered users can leave comments

Subscribe to the newsletter

We will send announcements of new articles and useful tips once a week