How to start pc automatically when power comes (Server)?

Can anyone tell me how to start pc automatically when power comes,
here I just want to start server automatically, on boot, my server starts automatically because I have written some startup commands in

 rc.local

file but if power fails, then how can I boot automatically

That is not a function of the PC software, that is a function of the system BIOS, which you must access before the OS boots. How to do so can vary, but often you see a screen like 'F2 for setup' or the like when the computer turns on.

In there you'll generally find a setting for what to do when power is restored.

Again, sorry to be vague but this varies a lot from PC to PC.

Thank you so much Corona, I will go through BIOS setting, I am using Dell Vostro 460, actually I could not find anything related to power setting so I thought OS may fix it, anyways thanks you cleared my confusion.