Howdy! You can lock a chest by putting a sign on it with [Private] on the top row, and your IGN on the second row.
Be careful to type your name correctly, otherwise you’ll need a mod to come and break the chest for you. If the sign doesn’t work (there’s some issues with signs globally), try putting &0 in front of both lines.