Try do it in advance since it is quite a long process.
You first to get a personal license which is granted by the council where you live. For this you need to pass an (easy) exam but you need to pay for it via a private learning company (around £150).
Then you pay for your criminal record check (something like £35) and for the application of the personal license (cost depends on the council, usually around £40). Then you need to wait to have your personal license (in tower hamlets it took 2 months!).
You can then apply for a premises license which means sending application forms to lost of different services (health and safety, fire, police...) with quality drawings (up to you to hire someone to do it but it will cost you), information o the business and the application fee. Again something like £40. You also need to advertise in the local news papers. In london, around £300.
If you want you can hire someone to deal with this whole mess but it will cost twice the price.
hope it helps