I plan on hiking the St-Jacques-de-Compostelle trail, starting in France and ending in Spain. To lower the costs, I would like to camp on my own outside.
Is it legal to camp outside in a small tent or bivy bag?
As a french hiker often going camping, here is what I know.
In France, camping is regulated by the law named « Camping, aménagement des parcs résidentiels de loisirs, implantation des habitations légères de loisirs et installation des résidences mobiles de loisirs et des caravanes » from the « décret n° 2015-1783 du 28 décembre 2015 relatif à la partie réglementaire du livre Ier du code de l'urbanisme et à la modernisation du contenu du plan local d'urbanisme ».
Here is a link summarizing what you can / cannot do: https://www.lecampingsauvage.fr/legislation-et-reglementation/camping-sauvage-bivouac (in French, but you can translate).
This law makes the difference between a "bivouac" and "wild camping". "Bivouac" is the term employed to nominated hikers that put a small tent for the night, as they may be too far from civilization. "Wild camping" however is more associated with people owning cars and putting a tent closer to the city, avoid hotel costs.
Camping is especially forbidden in some protected areas such as in some National Parks, but each park has its own regulation. If you go to the Pyrénées, there are the National N03, Regional park R43 and R46 (see the map in the previous link).
In N03, "wild camping" is forbidden, and "bivouac" is authorized between 7PM to 9AM the next day, if you are at more than one hour walk to the park limits, or road access.
In R43 (Parc naturel régional des Pyrénées catalanes), "wild camping" is forbidden, but "bivouac" is okay close to the refuges or along the GRs (the hiking ways).
In R46 (Parc naturel régional des Pyrénées ariégeoises), there are no specific legislation, so you have to follow the national regulation.
It is in general forbidden close to the roads, and you should know that any bit of land belongs to someone. The law says that you need the approval of the owner to put your tent there, who may live miles away.
That is the official legislation, but as a camper myself, I can tell you that no one will put you in jail for putting a tent for the night in a forest, just avoid the places where it is explicitly written on a sign. However, you should not leave any trace of your camp when you leave, so remember to take your garbage with you, and organize yourself for the "restrooms".
Have a safe trip!
As for spain, no, you are not allowed to free camp everhwere, but , there are camping zones and free camp zones ( different concepts ) in many places.
There is one important concept here :
every autonomous community of Spain has it's own legislation.
now, seeing that you want to go to the pyrinees, not a single of the AC there allows free camping (Navarre, Basque country, Aragon, Catalonia). you should rent a spot in one of the many mountain campings, they are cheap ( from 5€ to 25€ / night) , and offer commodities such as bathrooms, restaurant, etc. most of those campings are very vast in size, so you won't have trouble with neighbours.
These communities don't allow free camping due to the high number of forest fires caused by it, for example, since the ban in the 80's, forest fires caused by human hand on purpose ( leaving wood/coal burning, glass bottles on the ground, cigarettes...) gone down a lot.
1994 was a special case : an electrical failure on a landline that caused 45.000 burned ha of forest. and 1986 was a chemical accident.
as a gift : St. James trail , french route (from western france) campings.
As for France,
You are not -in theory- allowed to stay on private property without the owner's consent. /!\ forests might be private...
That's the theory, in practice if you set up a tent in the woods for a night (but don't step in homes' garden though ^^), don't set the forest on fire and leave it as clean as when you arrived, nobody would care.