external hardrive

hello to all i would like to know if its possible to install kodi on an external harddrive and run it and then attach it it via usb to my smart tv? so i can access it and watch films at my leisure if this is possible please could someone tell or instruct me on how this is done

i await inpatiently?