The code lock is the single most important thing you will build to keep what is yours in Rust. It is a cheap little keypad that bolts onto a door, and without one, anything you own is just sitting there waiting for the next passing player to open it. Nail this one item early and your loot, your base and your build privilege stay yours. Get lazy with it and you will log in to an empty base wondering what happened.
This guide is the full rundown on the Rust code lock: how to craft it, how to set a code and a guest code, exactly what you can lock, how it stacks up against the old key lock, and whether anyone can actually raid the thing. There is also a genuinely new twist worth knowing about, because the September 2026 Breach and Clear update changed how much your code locks quietly cost you in upkeep. If you just want the essentials, they are right below.
A code lock costs 100 metal fragments, its blueprint is known by default, and it needs no workbench to craft. Place it on a door, hatch, box, garage door or tool cupboard, then hold E and set a 4-digit code to lock it (the LED turns from green to red). Anyone who enters the correct code is remembered for good. You can also set a separate guest code for friends. You cannot raid the lock itself, so attackers just blow the door it sits on. New in the Breach and Clear update: code lock and tool cupboard authorisations now raise your base upkeep once your group passes four players.
- What it is
- What it looks like
- How to craft it
- How to set a code
- Guest codes
- What you can lock
- Code lock vs key lock
- Can you raid it?
- New upkeep cost
- Rest of the update
- FAQ
What is a code lock in Rust?
A code lock is a deployable keypad that secures a door or container behind a four-digit numeric code. Once it is locked, the only way through for anyone else is to type the correct code, find another way in, or blow the door off its hinges. It is the standard security item in Rust, and you will put one on more or less every door in your base.
Two things make it the default choice for almost everyone. First, the blueprint is known by default, so you can craft one from the moment you spawn without researching anything or finding a workbench. Second, it supports as many authorised players as you like, which is what makes it work for duos, trios and full clans, not just solos. You set a code, your teammates enter it once, and from then on the door just opens for them.
Compared to the older door-plus-key-lock setup that Rust veterans remember, the code lock removed all the hassle of crafting and carrying physical keys. That is why you will rarely see a key lock past the first hour of a wipe. The code lock simply does the same job better.
What a code lock looks like
A code lock is a small green keypad with a numeric pad, a little display, and a status LED that tells you everything at a glance. When the light is green, the lock is open and unlocked. When it glows red, the lock is set and the door is secured. Learning to read that light across your base at a glance is a real habit, because a stray green LED on a loot room door means you forgot to lock it.
The screenshot below is the real in-game code lock, mounted on a metal door with its green LED lit. Notice the keypad sitting at hand height on the door, exactly where you interact with it by looking at it and holding your use key.
How to craft a code lock
Crafting a code lock is about as simple as it gets in Rust, which is exactly the point. You want one on your first door within minutes of spawning.
The full recipe and item facts:
| Detail | Value |
|---|---|
| Cost | 100 metal fragments |
| Blueprint | Known by default, no research needed |
| Workbench | None required to craft |
| Craft time | About 30 seconds by hand, faster at a workbench |
| Stack size | 10 |
| Recycles into | 60 metal fragments (40 at a safe zone recycler) |
| Despawn time | 5 minutes on the ground |
| Item shortname | lock.code |
To make one, open your crafting menu, search for the code lock, and craft it. All you need is 100 metal fragments, which is a trivial amount you will have from smelting the metal ore off your first couple of nodes. Because there is no workbench requirement and the blueprint is already known, this is one of the very first things worth crafting on a fresh wipe.
Metal fragments are cheap, so batch craft a few code locks the first time you are near a furnace. You will want one for your front door, one for your loot room, and one for your tool cupboard, and carrying spares means you never leave a door open because you ran out.
How to set a code and lock it
Placing and arming a code lock takes about ten seconds once you know the steps. Here is the whole process.
- Place the lock. With a code lock in your hotbar, look at the door or container you want to secure and place it. It attaches to the lock slot automatically.
- Set your code. Look at the lock and hold your use key (E by default) to bring up the keypad, then type any four-digit number. That code becomes the master code and the lock arms instantly.
- Check the LED. The status light turns from green to red, confirming the door is now locked. That is it, the door is secured to your code.
From then on, you and anyone who enters the correct code are remembered permanently, so the door just opens when you use it. There is no need to re-type the code every time. That memory only resets if the code is changed, which instantly de-authorises everyone who was not the one who changed it.
While a code lock is unlocked (green LED), any player can walk up, remove it, or set their own code on it. That means if you place a lock and get distracted before setting a code, someone can lock you out of your own base. Always set your code the instant the lock goes on, and never leave a lock sitting unlocked.
Guest codes explained
The code lock has a second, less obvious feature that is genuinely useful: the guest code. This is a separate four-digit code that lets other players open the locked item without giving them any control over the lock itself. Guest users can come and go, but they cannot change the main code, set a new code, or remove the lock. It is perfect for letting a temporary ally into a shared compound, or giving a trade partner access to one specific door.
Setting a guest code works a little differently from the main code, and this is where people trip up:
- Unlock the lock first. A guest code can only be set while the lock is unlocked. Enter your main code so the LED goes green.
- Choose the guest code option. Look at the lock, hold E, and pick the guest code option from the wheel, then type the four-digit guest PIN.
- Re-lock it immediately. This is the part people forget. After setting the guest code you must lock the door again, because while it is unlocked anyone can tamper with it.
Give a guest code, not your main code, to anyone you do not fully trust. A guest can open the door but can never lock you out, change the code, or pull the lock off. When the arrangement ends, just change the main code and the guest access is gone with it.
What you can put a code lock on
A code lock fits almost anything with a lock slot. If it is a door, a hatch, a gate, or a container you can build or deploy, odds are you can code lock it. These are the ones that matter most.
| What you lock | Why it matters |
|---|---|
| Doors | Wood, sheet metal and armored doors all take a code lock. This is the main job. |
| Garage doors | The classic loot-room door, locked the same way as any other. |
| Tool cupboard | Lock your TC so raiders cannot clear your build privilege and take over your base. |
| Storage boxes | Wood boxes, large boxes, coffins and more, for a second layer inside a locked room. |
| Hatches | Ladder hatches and floor hatches into your base or bunker. |
| Gates and more | High external gates and most deployables with a lock slot. |
New players secure their doors but forget the tool cupboard. If your TC is unlocked, a raider who gets inside can authorise themselves, clear your building privilege, and start deconstructing your walls for free. A code lock on the cupboard is not optional, it is the difference between a raid and a total takeover.
Code lock vs key lock
Rust has two locks: the code lock and the older key lock. Both are known by default, but they work in completely different ways, and one of them is the clear winner for almost every situation.
| Code Lock | Key Lock | |
|---|---|---|
| Cost | 100 metal fragments | 75 wood |
| Access | 4-digit code anyone can be told | A physical key item you craft and carry |
| Multiple users | Unlimited, all remembered | Each user needs their own crafted key |
| Guest access | Yes, a separate guest code | No |
| Main weakness | Someone could watch you type the code | A stolen or looted key opens the door |
| Best for | Everything, all wipe long | The first hour before you have 100 frags |
The verdict is not close. The key lock is 75 wood, so it is marginally cheaper and useful in the opening minutes of a wipe when you have wood but no metal. But keys are clunky. Everyone who needs access has to craft their own key, keys can be looted off your corpse, and there is no guest option. The code lock costs a bit more but solves all of that, which is why it is the standard. Slap a key lock on your very first door if you must, then replace it with a code lock the moment you have the fragments.
Can you raid a code lock?
Here is the thing that confuses a lot of new players: you do not raid the lock, you raid the door it is on. The code lock has no meaningful health of its own that a raider targets. It cannot be shot off, and there is no way to “break the lock” and leave the door standing. To get through a locked door, an attacker has to destroy the whole door, and the cost of that depends entirely on the door tier, not the lock.
| Door the lock is on | HP | C4 | Rockets | Satchels |
|---|---|---|---|---|
| Wooden Door | 200 | 1 | 1 | 2 |
| Sheet Metal Door | 250 | 1 | 2 | 4 |
| Garage Door | 600 | 2 | 3 | 9 |
| Armored Door | 1,000 | 3 | 5 | 15 |
The takeaway is simple: your door tier is your real security, and the lock just keeps honest players out. A code lock on a wooden door is one C4 or two satchels away from being opened. Put that same lock on an armored door and it now takes three C4 or fifteen satchels. The lock is identical, the cost to raid is not. So if you care about a loot room, spend on the door, not just the lock. See the full breakdown in our C4, rocket and explosive ammo guides.
What about guessing the code?
Every code lock uses a four-digit numeric code, so there are 10,000 possible combinations. In theory someone could stand there and try codes, but Rust makes brute-forcing painful. After 8 failed attempts, a player is locked out of that keypad for 15 minutes, and each wrong guess also shocks the player for increasing damage. Sit there stubbornly guessing and the lock will electrocute you to death long before you get in. In practice, nobody raids by guessing, they use explosives on the door instead.
Avoid 0000, 1234, 6969 and the classic Rust meme codes. Raiders and cheeky passers-by will try those first, and with only eight attempts before a lockout, an obvious code is the one weakness the shock timer cannot protect. Pick something random and personal to your group.
New: code locks now affect your upkeep (September 2026)
Here is the fresh change worth knowing about. The Breach and Clear update on 3 September 2026 added a group-scaling upkeep system, and it directly involves your code locks. Base upkeep now goes up based on how many players are authorised on your base, and that count includes both tool cupboard authorisations and code lock authorisations.
| Group size | Extra upkeep | Who it hits |
|---|---|---|
| 1 to 4 players | None | Solos, duos and small teams pay the normal rate |
| 5 to 10 players | +2% per extra player | Each player past four adds to the bill |
| 11+ players | +4% per extra player | Big clans stack fast, up to roughly +300% at the cap |
The design goal is clear: make giant zerg bases genuinely expensive to maintain, so a huge group has to pour far more resources into upkeep than a solo or a duo. There are two details that catch people out. First, the penalty is calculated from the number of authorised players, so being loose with who you add to your locks and cupboard now has a real cost. Second, removing a player does not drop the tax straight away. The system remembers a de-authorised player for 24 hours before it recalculates, so you cannot dodge the fee by kicking people right before an upkeep tick.
You can check exactly what your group size is costing you by hovering over the tool cupboard information in game. If the number looks high, prune the players you no longer need on your locks and cupboard, remembering it takes a day for the reduction to kick in.
Code locks and the wipe cycle
Like every deployable, your code locks are wiped when the server does. A force wipe clears the map and all structures, so on day one of a fresh wipe you are starting over: new base, new doors, new codes. That first hour is also the most dangerous window to be caught with an unlocked door, because everyone is roaming and grabbing whatever is not nailed down.
The players who come out of a wipe ahead are the ones who lock down fast. Knowing exactly when your server force wipes lets you be online, ready, and slapping code locks on your doors the moment the map goes live, instead of scrambling after everyone else already has walls up.
Do not get caught with an open door. Know exactly when the next force wipe hits so you are ready to lock down from the first minute.
Check the force wipe countdownThe rest of the Breach and Clear update
The upkeep change is just one line on a big patch note. The September 2026 Breach and Clear update touched a lot of Rust at once, and a few of the other changes are worth knowing about, several of which the site covers in full.
| Feature | What changed |
|---|---|
| Monument blockers | Destructible barricades now sit on routes into red keycard puzzle rooms, slowing the wipe-day loot rush. |
| HQM nodes | High quality metal now spawns as its own rare ore node, most common out in the jungle. |
| Breakable heli armour | The attack helicopter now loses armour panels at set damage thresholds, exposing the crew as it takes fire. |
| Honey Bandage | A new Workbench 1 heal that sits between a bandage and a syringe. |
| Upkeep group scaling | The change covered above, tying base upkeep to how many players are authorised on your locks and cupboard. |
Read together, the update nudges Rust gently in favour of the smaller player. Monument blockers slow the biggest groups off the wipe-day rush, the upkeep tax makes giant clan bases genuinely expensive to hold, and HQM nodes hand solos a fresh way to fund their first armored walls. Your humble code lock sits right in the middle of one of those changes.
Rust code lock FAQ
How much does a code lock cost in Rust?
A code lock costs 100 metal fragments to craft. The blueprint is known by default, so you do not need to research it, and no workbench is required, meaning you can make one from the moment you spawn on a fresh wipe.
How do you set a code on a code lock?
Place the code lock on a door or container, then look at it and hold your use key (E by default) to open the keypad. Type any four-digit number and the lock arms instantly, with the LED turning from green to red. Anyone who later enters that same code is remembered and can open the door freely.
How do you set a guest code in Rust?
First unlock the lock by entering your main code so the LED goes green. Then look at the lock, hold E, choose the guest code option, and type a separate four-digit guest PIN. Lock the door again straight after. Guests can open the door but cannot change the main code, set a new code, or remove the lock.
What is the difference between a code lock and a key lock?
A code lock uses a four-digit code that any number of players can be given, and it supports a guest code. A key lock costs 75 wood and uses physical key items that each user must craft and carry, with no guest option. The code lock is more convenient and is the standard choice; the key lock is only really useful in the first hour before you have 100 metal fragments.
Can you raid a code lock in Rust?
You cannot destroy the lock itself or shoot it off. To get through a locked door, a raider has to destroy the whole door, and the cost depends on the door tier. A wooden door takes 1 C4 or 2 satchels, a sheet metal door 1 C4 or 4 satchels, and an armored door 3 C4 or 15 satchels. The lock adds no health, so your door tier is your real security.
How much HP does a code lock have?
The code lock is not a separate target that raiders damage or break off. It has no health bar you can attack, and it cannot be removed while it is locked. Attackers instead destroy the door or container it is attached to, so the health that matters is the door’s, not the lock’s.
Can someone guess a code lock code?
In theory, since there are 10,000 four-digit combinations. In practice it is not viable. After 8 failed attempts, a player is locked out of that keypad for 15 minutes, and each wrong guess shocks them for increasing damage. Guessing will get you killed long before you get in, which is why raiders use explosives on the door instead. Just avoid obvious codes like 0000 or 1234.
Can you put a code lock on a tool cupboard?
Yes, and you should. A code lock on your tool cupboard stops a raider who gets inside from authorising themselves and clearing your building privilege. Locking your doors but leaving the TC open is a common beginner mistake that turns a small raid into a full base takeover.
Do you need a workbench to craft a code lock?
No. The code lock needs no workbench and its blueprint is known by default. All you need is 100 metal fragments, which makes it one of the first things worth crafting on a new wipe. A workbench only speeds up the craft time, it is not required.
What happens if you leave a code lock unlocked?
While a code lock is unlocked, with a green LED, any player can walk up and remove it or set their own code on it. That means an unlocked lock can be used to lock you out of your own base. Always set your code the instant you place the lock, and re-lock immediately after setting or changing a guest code.
How do you recycle a code lock?
Put a code lock into a recycler and it breaks down into 60 metal fragments at a standard recycler, or 40 at a safe zone recycler. Since it only costs 100 fragments to craft, recycling spare or looted locks is a decent way to reclaim metal.
Do code lock authorisations really cost upkeep now?
Yes, as of the Breach and Clear update on 3 September 2026. Base upkeep now scales with the number of authorised players across your tool cupboard and code locks. The first four players are free, then it adds roughly 2% per player for groups of 5 to 10, and 4% per player at 11 or more, up to about 300% at the cap. Removing a player still counts them for 24 hours before the tax drops.
Is the code lock known by default in Rust?
Yes. Both the code lock and the older key lock are known by default, so you never have to research a blueprint or find one in a loot crate. You can craft a code lock straight away on any wipe as long as you have 100 metal fragments.
The bottom line
The code lock is the most essential item in Rust that nobody talks about, because it just quietly does its job. For 100 metal fragments and no workbench, it turns a door into a barrier, keeps your loot yours, and supports your whole team through a four-digit code and an optional guest code. Lock your doors, lock your boxes, and above all lock your tool cupboard, because an unlocked TC undoes everything else.
Remember that the lock is only ever as strong as the door under it, so spend on door tiers where it counts, and keep an eye on the new Breach and Clear upkeep tax if your group is growing. Then all that is left is to be online and ready when the map goes live, code locks in hand, so your base is sealed before anyone else has walls.
Lock down from minute one. Line up your wipe day with the countdown and secure your base before the rush.
See the force wipe countdownSources
- Facepunch Wiki, Code Lock for the 100 metal fragment cost, known-by-default blueprint, stack size, 5 minute despawn, recycle yield and item shortname.
- Corrosion Hour, Code Lock for how to set the main and guest codes, player authorisation, what the lock attaches to, and the 8-attempt 15-minute lockout.
- Corrosion Hour, RUST September 2026 Update Preview for the upkeep group-scaling thresholds, the code lock and tool cupboard authorisation count, and the 24-hour rule.
- Facepunch, Breach and Clear devblog (3 September 2026) for the wider update feature list.
- Rustafied, Breach and Clear Update Incoming for update context and community testing notes.
