Do I have to have a bar code to sell my product on a website?

Only if the retailer requires it. Each store can choose to manage their inventory differently, some may create their own internal codes (SKU's) that work for only them, others may want you to have GTIN's (UPC's & EAN's). 

If you have your own website and do not plan on selling your items into other stores/sites, you will not usually need GTIN's.