The previous tenant may still have a set. The agent has one, the owner has one, and the cleaner probably knows the code of the lockbox. Here is what you can actually do about it in Spain, what it costs, and the small detail about the old cylinder that saves an argument three years from now.
Nothing in the Spanish urban lease law forbids a tenant from changing the cylinder of the front door. You are paying for the use of the flat, and control of access is part of that use. Spanish consumer bodies give the same blunt advice: change the cylinder, keep the invoice, and do not hand over a copy unless you feel like it. The owner keeps the right to be told about repairs. He does not keep the right to walk in.
Two nuances worth knowing. The door of your flat is a private element, so the cylinder is yours to change. The portal door, the garage door and the mailbox are common elements, and there you cannot touch anything without the community. And if the building is protected, or the flat sits behind an original wooden door in a listed finca regia, changing the whole lock set or bolting steel plates onto it can run into heritage rules. The cylinder inside the existing lock is almost never the problem.
The flat was a short let until last spring and the lockbox code has been sent to several hundred strangers. Or the owner's cousin cleaned it for years and still has a key "just in case". Or the previous tenant handed back two keys out of four and nobody counted. Or you simply do not know, and a €40 cylinder is cheaper than one bad night.
There is also the break-in version: someone tried the door, the lock was forced and repaired badly, or your keys disappeared at the beach. Same answer, done faster, ideally before the insurance assessor asks why the lock still has a fresh scratch on it.
A basic europrofile cylinder costs €15–30 in a hardware shop, a mid-range security cylinder €40–70, and the anti-bump, anti-drill, anti-snap models that insurers like €90–200. A locksmith charges €40–90 for the labour of swapping a cylinder, so a normal job lands at €60–120 all in. A high-security cylinder in a heavy armoured door can reach €180–250. Out of hours the same visit is €120–350, which is why the smart move is a Tuesday morning and not a Saturday night.
A whole new lock rather than just the cylinder is €200–300 and usually unnecessary. The cylinder is the part that carries the key. It is also the part a previous tenant could have copied.
If the lock is old, jams, or the key snapped inside because the mechanism is worn, that is keeping the dwelling in working order and, under article 21 of the LAU, the owner's cost. If you lost the keys, had them stolen, or simply want a cylinder the previous tenant never saw, it is yours. That is the rule in practice, and it is worth thirty seconds of WhatsApp before calling anyone, because a reasonable owner usually agrees to the change and often splits it.
Keep the invoice and send a photo of it. It is exactly the kind of small document that becomes evidence if a deposit argument appears two years later, and it also proves the flat had a new cylinder when you moved in.
Many Spanish leases say the owner keeps a copy. The clause is common and not automatically abusive: without a key he cannot deal with the burst pipe on the floor below while you are in Berlin. What the clause does not do is give him the right to come in whenever he likes. Article 21 covers urgent repairs; anything else needs your consent or a court order. The dwelling is yours for the length of the contract.
If you change the cylinder, tell the owner in writing, calmly: the cylinder has been changed for security reasons, the flat is still accessible with notice, here is the invoice. Leave a copy in the portería only if you want the plumber to get in while you are away, and say that in the same message. A short written trail beats a verbal promise every time.
A €150–400 smart lock is a neat answer in a flat with three adults, a cleaner and a dog walker, but read the fine print. The owner's app should not keep permanent remote opening, guest codes should expire, and the mechanical key must still work when the battery dies — which it will, at 22:40, on a Sunday. If the lock only opens over WiFi, you have swapped a key problem for a router problem.
Whatever you fit, list it in the inventory with the serial number, and keep the old cylinder in a labelled bag in the trastero. Most leases ask for the flat back as received, and refitting a €25 cylinder on the day you leave is the least dramatic way to satisfy that sentence.
Ask before signing how many keys exist and who holds them. A good agency answers with a number: two sets for you, one for the owner, one for the file. A vague answer is also an answer. If the flat was a short let, propose changing the cylinder on day one and writing the cost into the contract as a deduction from the first month — most owners accept, because the change protects them as well.
Then count the keys in front of the agent against the inventory line, which usually reads "llaves: 2 juegos". Photograph them on the table. It takes a minute and settles the whole question later.
Hand back every key and every remote against a signed list. If you kept the original cylinder, refit it — five minutes with a screwdriver — and return the original keys. If you leave your own cylinder in place, hand over all its keys. Nobody argues about a better lock; people argue about a missing key at nine in the morning on handover day.
One more thing: if the flat has an alarm wired to the door, call the alarm company before you change the cylinder. A contact that no longer closes is a false alarm at three in the morning, and the guard's call-out is invoiced to whoever holds the contract.
We read the contract, the inventory and the small clauses before you sign, and we tell you which ones are worth an argument.