About a quarter of people have at least one neighbor they absolutely hate, citing reasons like noisiness or issues with trespassing. It’s one thing if the jerk next door is just some stranger you don’t get along with. But what if they literally own the place you’re renting?

If that’s the situation you’re heading into (or are already in), there are three things to do immediately to to help ensure your living situation doesn’t turn into a nightmare.

Establish a relationship

When it comes to both neighbors and landlords, communication is key. You will need to interact with your landlord and your neighbors, so the first thing you should do when moving into your new landlord-adjacent place is establish that relationship. Not only does interacting with your neighbors in general offer psychological and practical benefits; you also don’t want the first time you meet your landlord in person to be when you’re asking them to fix a problem.

Establishing a friendly rapport with your landlord will make it a lot easier to address issues and make requests. But it also transforms you from a name on payment to a neighbor, a real human being your landlord can have empathy for.

Establish boundaries

Establishing that relationship with your landlord doesn’t mean becoming best friends with them, however—this is a business relationship, and you should treat it as such. Being friendly is fine, but you need to establish boundaries as well, or things will get really awkward should you have a dispute with your landlord.

Communication. Compartmentalize and silo your interactions—there should be a specific way that you communicate with your landlord about apartment-related issues, as opposed to friendly neighbor banter. Pretend you’re not living next door, and ask your landlord how they prefer to hear from tenants—text? Email? By phone? Then stick to that. Unless your landlord specifically says they want you knocking on their door every day to complain about a leaky faucet, treat them almost like two separate people: Your neighbor, and your landlord.

Don’t pester them (and don’t let them pester you). This is a two-way street. No, you shouldn’t knock on your landlord’s door every time you have a question or a problem. But you also shouldn’t tolerate a landlord who abuses their proximity to constantly insert themselves into your day or offer a running commentary on your lifestyle decisions. There’s not much you can do legally unless they cross the line to harassment or violate your privacy (see below), but you can at least politely (but firmly) insist on that mode of communication you established—but also make sure you also follow those rules.

Secure your privacy

One way having your landlord living next door can grate on your nerves is the worry that they’ll act as Fun Police, constantly peeking through your windows and monitoring your lifestyle. A nosy neighbor is annoying enough, but when that neighbor can then knock on your door and demand that you stop doing something because they own the place, you can feel powerless and violated.

So, take some steps:

Research the applicable laws in your area. Landlords do enjoy a “right of entry” and can generally enter your apartment under certain conditions, but the tenant also enjoys a right to privacy and “quiet enjoyment.” Landlord access may also be spelled out in your lease. While most landlords have better things to do than wander around your apartment, it’s good to know your rights before you come home to discover them rooting around in your fridge.

Add privacy in renter-friendly ways. The old saying about good fences making good neighbors applies here: If you make it difficult for neighbors to invade your privacy, it’s less likely they will. And taking some common-sense steps to increase the privacy of your new home will also make it less likely that your landlord might innocently observe something you don’t want them to necessarily see. Some things you can do without risking your security deposit include putting renter-friendly privacy film on your windows, using removable tension rods to put up some curtains, installing potted plants in your outdoor areas, and adding a screen to your patio. None of these moves will endanger your security deposit, but they will give you a sense of true privacy inside your home.

There’s no reason living next door to your landlord has to be a nightmare—but the key to avoiding a nightmare scenario is being proactive. Set some boundaries, establish lines of communication, and protect your privacy and it might be great having your landlord as a neighbor.