How to unlock an iPhone 5 after the contract is done?

PS: I have to do it on my own

You can't. You need to either pay the phone company to unlock it or to take the phone to an independent unlocking specialist and pay them to do it instead.

There's no free or DIY option.

There's a way. All you need is have a software for it, but you need to jailbreak it before you can do the unlocking process. There are software that does have two functions, the "Jailbreaking & Unlocking". You just need to choose the right one.