If it has Snow Leopard (10.6) or greater then you might be able to upgrade to Lion or Mountain Lion through the app store. If it is on Leopard then it won't have the app store so you will need a disk. You can buy Snow Leopard, Lion or Mountain Lion on disk from Apple for £14.99.
Just last week I upgraded an early 2009 Mac Mini I inherited (the one with the mini-DVI port) to El Capitan.
I'm new to Macs and the memory's a little short these days(!) but I'm pretty sure I just by searching for "El Capitan" in the app store and downloading it from there.
Cheers for the tips guys. It's currently running 10.6.8 but if I search for El Capitan on the App Store, it brings up Sierra which I can't download. Will have to buy a disc from Apple.