This is a type of power supply that electricians often have to house for electrical safety and fire code or weather protection reasons.
I'm building a 3-d printer, which will be driven by a smoothieboard. This needs a 24V power supply. I've bought the one shown below:
Ahhh yes. As far as I can tell it doesn't have a fan, so take that into account. Some have a best orientation for convection cooling as well. Cooling required will depend on load.
What I don't know is how to house this safely.
I'd recommend a standard electrical box. I'd grab a standard 12x12x4 or 12x12x6 metal junction box, preferably without knockouts like [this one]. You can get these at large hardware stores or electrical suppliers. The size of the box will determine how much load the power supply can have without ventilation, but I'd grab the 12x12x4 as it's big enough to be easy to work in, test with it and add a filter and fan if necessary(or just to be prudent).
I think there's something called ferrules I should be using to connect wires to those screw contacts?
Try searching for solder on or crimp on spade connectors. Be sure to check the current rating and feel free to grab insulated ones.
But I can't just have a mains lead splitting into two wires and going straight into those terminals, surely? That would still leave a bit of bare wire exposed as a hazard.
If you want to, you can use a connection as simple as baring an appropriate amount of wire, twisting it to ensure good compression and clamping it under the terminal. Done properly, this is a secure electrical and mechanical connection, and there is nothing wrong with it. Using spade connectors simply removes the small amount of skill involved. It is wise to minimize bare wire, but the insulation should come up to within a mm of the terminal block and the wire should reach the end of it.
How did other people house these? Is there some kind of standard enclosure I can get?
Yes. See above.
I also bought a 'kettle-lead plug' with a switch and fuse. Again, I presume I can get some kind of enclosure to fit these to, but from where?
You cut a custom hole in your enclosure sized to fit.(This is where an enclosure free of existing knockouts is nice) For tools I recommend a drill and bastard file and your choice of dremel, hacksaw, angle grinder, knockout punch, metal sheers, or if you want the tool specific to cutting specialized holes in sheet metal, get a sheet metal nibbler. The plug is a good addition as it will save you the trouble of putting a strain relief on the cord where it enters the box.
You should figure out how you're going to mount the power supply in the box for orientation, firmly secure it and ensure the casing and ground terminals are firmly connected to the ground terminal provided in the junction box. You may wish to use standoffs to suspend the power supply inside the box, allowing air flow on all sides, and you may wish to do the same with the box, especially if you would prefer to rely on convection cooling if possible.
Where other wires penetrate the box, if you want you can find detachable connectors for them too, but it would be normal to hard wire them. If you want to hard wire them, be sure to use a suitable grommet to protect the wires where they enter the box, and because you may wish to reterminate them more frequently than the power wires, I would be more likely to throw spade connectors on these.
Anyway, put it all together, mount it to the underside or back of a desk and run a half hour print, pull the cover and see how warm it is(probably won't be) then run a two hour print, check it, and another two hour print back to back, check it again, and if it seems to be heating up, I'd add a 24v fan pulling air out of the box and a vent and filter on the other side. Doing this will save you the trouble of learning how to calculate the resistance of a thermal path (in this case conduction->convection->conduction->convection) although you can find good explanations of that on here too. If you're willing to commit to a fan, you could also choose a box exactly large enough to fit the components, or build one yourself from sheet metal. If you can build it with scissors, paper or cardboard and scotch tape, you can build it with sheet metal and screws.