Spanakopita, or spinach pie, is a Greek classic: sweet, earthy leaves and salty cheese encased in layer of shatteringly crisp pastry, it’s as good for breakfast as it is for lunch or dinner. Being delicious hot or cold, vegetarian-friendly and fairly cheap to put together, it’s my current top tip for a picnic. It also, of course, makes a nice lightish lunch or dinner, especially with a tomato salad on the side and, should you wish to make it in little triangles or cigars, rather than one large pie, is finger food of the highest order. In short, if you don’t have one already, you need a recipe for spanakopita in your life.

The spinach

In truth, though I’ve chosen spanakopita because spinach is more widely available than the many other wild and cultivated greens used in similar pies in Greece, you can use whatever quick-cooking leaves you have available: Christina Mouratoglou and Adrien Carré of London restaurant Mazi give a recipe in their book of the same name for hortopita, which uses nettles and cavolo nero as well as spinach, while the Serious Eats website recommends using rainbow chard, rocket and watercress for a more interesting flavour: treat them in much the same way as the spinach in this recipe.

Facebook Twitter Pinterest Christina Mouratoglou and Adrien Carré of London restaurant Mazi give use nettles and cavolo nero as well as spinach. Thumbnails by Felicity Cloake for the Guardian.

In general, however, spanakopita recipes call simply for spinach, which, without further qualification, I assume to mean adult leaf, given that the Greeks seem too sensible a society to have abandoned it in favour of the oppressively iron-y baby leaf stuff better suited to salads (I try that in one recipe, and find it almost dissolves into the filling). Fortunately, I have a number of greengrocers nearby, but if you don’t, frozen whole-leaf spinach turns out to be a very decent alternative: make sure you defrost it thoroughly, then squeeze dry before adding it to the filling.

In fact, whatever you use, it should be as dry as possible before it goes anywhere near the pastry, so you’ll need to reduce the water content. One way of doing this, of course, is to wilt it over heat until it sits in a pool of its own juice, and then drain it well, an approach favoured by Akis Petretzikis, Diane Kochilas and the Mazi cookbook, but I think this risks overcooking it. Much better to do as Vefa Alexiadou recommends in Greece: The Cookbook and massage the fresh leaves with salt instead: it’s quicker and the end result tastes much fresher. This also has the benefit of keeping the filling mixture relatively cool, which means you can bake it straight away without worrying any residual heat in the spinach will spoil the pastry. (NB: you can skip this step with frozen leaves.)

Facebook Twitter Pinterest Vefa Alexiadou’s spanakopita: massage the fresh leaves with salt.

The dairy

This is entirely optional: Lenten recipes leave it out altogether, and there are vegan versions using tofu, but if you eat cheese, I’d highly recommend it, because it’s delicious. Feta is the standard choice, but a few recipes also add some grated kefalotiri, a harder, richer cheese often served fried as saganaki, though I don’t think it needs the extra flavour, unless you happen to have some in need of using up. Mazi is the only pie to eschew the white crumbly stuff altogether in favour of a bechamel sauce made with parmesan, which feels a bit underpowered in comparison: feta can’t be bettered, apparently.

Traditionally, the filling is enriched with eggs, though Petretzikis uses cream cheese to give it a richer consistency, Tess Mallos uses ricotta, and Sofia Souli, whose Greek Cookery And Wines comes highly recommended by Jack Monroe, sticks in some evaporated milk and a good glug of oil as well, while Alexiadou uses ordinary milk and melted butter. Oil, butter and cream cheese are all judged a bit rich by testers, and evaporated milk a little sweet – indeed, it strikes me that, having worked so hard to squeeze the moisture from the leaves, it’s a bit counterintuitive to add more back in, with the exception of egg, which will set in the oven and firm up the filling in the process.

The flavourings

All the recipes use alliums of some sort: leek and spring onion for Mazi, red onion and spring onion for Kochilas, white onion for Souli, and spring onions alone for Alexiadou and Petretzikis. I like the sweetness of the red onion and leek, and the grassy flavour of the spring onions, so, like Kouchilas, I’m going to use both.

Facebook Twitter Pinterest Sofia Souli ‘sticks in some evaporated milk and a good glug of oil as well’.

Far more important, in my opinion, is a generous hand with the herbs, which sets this dish apart from the hundreds of other permutations on the spinach-and-cheese theme from around the world. Dill is the most common choice, closely followed by mint and parsley, though Mazi also adds chervil and fennel leaves and Petretzikis Mediterranean hartwort and oregano. Hartwort proves hard to come by in a British summer, so, on advice, I use lovage instead, which gives the filling a very savoury quality, while chervil and fennel lend an aniseedy, almost ouzo-like whiff that’s more popular with the panel. Dill is easier to get hold of, however, and along with mint for freshness and a little oregano for Greekness, should provide enough in the way of herbaceous excitement.

Petretzikis’s zippy lemon zest and a good grating of nutmeg are far more interesting seasonings than the more usual pepper and, rather boldly, I’m also going to add some bulgur wheat on Kochilas’s recommendation: not only does this help soak up any excess liquid, but it also gives her filling a far more interesting texture. You could use rice, or the little balls of grain and fermented milk known as trahana, if you’re lucky enough to have some – or, indeed, leave this element out altogether if you prefer.

The pastry

Though spanakopita is generally made with filo in restaurants and professional bakeries, Kouchilas and Petretzikis both make their own horiatiko, or village-style pastry, which is rather thicker and sturdier, but better flavoured than most commercially produced filo. However, the testers revolt, demanding more crunch and less wholemeal – one even goes as far as to threaten not to help again if I leave out the crisp top. That said, I’d recommend you have a go at homemade rustic filo one day; it’s not much like the other stuff, but it is rather good.

Last, a tip from Petretzikis: drizzle the sheets of pastry with olive oil rather than brushing it on, “so that they don’t stick to one another and air pockets can be created in between them. This makes the phyllo crunchier!” And one from me: leave the pie to cool slightly, or completely before serving for maximum enjoyment.

Perfect spanakopita

Prep 20 min

Cook 30 min

Makes 6-8 pieces

1kg adult spinach, or frozen whole leaf spinach, defrosted

Salt

2 tbsp olive oil

1 red onion or leek, finely chopped

4 spring onions, chopped

300g feta, crumbled

25g dill, chopped

20g mint, leaves removed and chopped

3 sprigs oregano, chopped

50g bulgur wheat (optional)

2 eggs, beaten

Zest of 1 unwaxed lemon

Nutmeg

250g filo pastry

Oil, to brush

Trim the spinach and wash well, then roughly chop. Put in a colander with a good sprinkle of salt, and massage until it wilts (omit this stage if using frozen).

Facebook Twitter Pinterest Trim, wash and chop the spinach. Photographs by Dan Matthews for the Guardian.

Gently fry the red onion or leek in the oil until softened, then take off the heat and stir in the spring onion. Tip into a large bowl with the feta, herbs and bulgur, if using.

Facebook Twitter Pinterest Fry your onions, then add feta, herbs and bulgur wheat to your well-wrung spinach...

Wring the spinach in handfuls until no more liquid comes out (it should look thoroughly wilted), stir into the cheese mix, then add the egg, zest, a glug of oil and a good grating of nutmeg and mix again (I find hands the best tool for this). Season lightly, remembering that feta is quite salty.

Facebook Twitter Pinterest Line a baking pan with half the filo: brush each sheet with oil and layer up.

Heat the oven to 200C/390F/gas 6. Brush a 30cm x 25cm baking tin with olive oil, then line with half the filo, brushing each sheet with oil as you go (a spray is useful here, if you have one), and taking care not to press them down in the process. Leave any excess overhanging the sides.

Facebook Twitter Pinterest Spoon in the filling, fold over the pastry edges...

Spoon in the filling, level the top, then put the lid on: repeat the layering process with the remaining pastry. Fold the overhang inwards, to make an edible rim, drizzle with more oil and cut into the desired portion sizes. Bake for about 30-40 minutes, until golden.

Leave to cool slightly before serving.

Facebook Twitter Pinterest Layer more filo to make the top, brush with oil, then bake.

• Spanakopita: a Greek god of a pie, or are there others in the pantheon that deserve to be better known? What do you put in yours, and just why is it so hard to get decent spinach in the UK?