Switching back to iOS12.3 from iOS 13 beta 3 I want to switch back to iOS12.3 from iOS 13.

For this apple support says that It can be done by restoring backup from iTunes:

But iTunes is not installed on my Ubuntu computer. so How to switch back to original iOS from iCloud backup?

One crude way I understand, is to format iPhone and this will turn phone into new one, then I can restore the backup from iCloud. Will formatting the iPhone restore the iOS 12.3 ?

Edit: I erased everything, and restarted as new iphone/also restored from very old icloud backup. But phone didn't switch back to iOS12.3.
If you have ran a backup using iCloud while on iOS 13, and you don't have iTunes, there is unfortunately nothing you can do. If you have iTunes, you could restore from an old backup if you have one, or you can set up as a brand new phone on iOS 12.3 if you download the .ipsw file for your phone model and correct iOS.