How do I install a self-signed certificate to localhost?

My new manual: How to build a certificates chain of trust in Windows using openssl?