Does it matter if UE is installed on HDD if the project is saved on my SSD?

My SSD is quite small like 256GB and it also has the OS on it, so it’s even smaller and I thought that installing the engine on my HDD would not cause any problems regarding compiling speed, but it takes almost every time over 10-15 seconds for every small change. Do I need to install the engine on the SSD to make it build faster?

Maybe, maybe not. There are many things that can make compilation slow.
How much RAM do you have? How fast is your CPU? If you’re limited on RAM or CPU, the disk doesn’t matter as much.
That being said, if you’re using Visual Studio, and building C++ changes, then, yes, it’s very likely the disk speed does matter.

It’s reasonable affordable and easy to replace a main SSD with something bigger these days, as long as you can have both disks plugged in at once to “clone” the old one onto the new one. Most disks come with software to do it (if you buy “retail” packages,) or you can boot Linux from a USB stick and use something like “dd” to do it (assuming you’re Linux-savvy – if not, then that might be a way to lose all your data instead :smiley: )
Definitely a worthy upgrade, if you’re thinking about an early Christmas present for yourself!

My build is RTX 3070, Ryzen 5 5600x, 16GB RAM and idk what else matters. I thought that having these would speed up a lot building time.

Btw I’m using Rider not VS.

16 GB RAM may not be enough for a bigger project. You might want to open up Windows Performance Monitor and see what resources are being maxed out – is it using a lot of disk, or a lot of CPU, or something else?
Rider vs Visual Studio isn’t that different, as they use the same build tools.