For many people, working from home sounds like a dream—no boss breathing down your neck, no noisy coworkers blabbering or chewing loudly, no commute hijacking your free time, no one telling you to put on pants.

A lot of people are making the switch, too: The freelance economy is growing exponentially, and more companies are allowing full-time employees to work from home part-time. Some 25% of employees did some or all of their work from home in 2015, according to data from the Bureau of Labor Statistics.

But while you working from home might give you more time to work out and prepare healthy food, it can actually present some challenges to your physique. It even affects fitness professionals: Los Angeles-based personal trainer Mike Donavanik, C.S.C.S., said he recently experienced weight gain himself while transitioning to a more sedentary role.

“I went from training clients as 70% of my time to that being 30% of my time while I’m creating more online content,” says Donavanik. “I was like, ‘Why am I gaining weight?’ And then realized, ‘Oh, because I'm sitting down way more, and I'm not moving as much as I used to.’ It was an eye-opener.”

If you’re afraid you’ll gain weight once you start working at home—or if you’ve already noticed you’re getting softer with an at-home gig—check out expert tips for staying healthy and fit while working from home.

1. Wear pants with a tight waistband

You’re probably excited to swap the work slacks for sweats, but it’s a good idea to put those pants on at least once a week to make sure they fit.

“When I wear jeans that are tighter, I'm like, ‘OK, I should go to the gym to keep this up,’ because I know if I stay in sweats, I’m likely to gain weight,” says Donavanik. “My first year in college, I wore sweats all the time, and then the next thing I knew, after the first semester in college, I was 20lbs heavier. I tend to put on workout clothes now while working from home, but still, you've got to make sure your pants with a waistband still fit, because that's when you’ll start noticing that you’ve gained weight.” (And no, you can’t blame the dryer for shrinking your pants.)

When Donavanik noticed that his pants were getting tighter after being more sedentary at home, he realized, “I either need to watch what I eat or I need to work out a little harder in the gym. My solution was just to work out harder in the gym.”

2. Set up your environment for success

“People tend to want to pour all of their energy into increasing self-control and building self-discipline, but I would prefer people put more energy into creating a home environment that is conducive to good health,” says Torey Jones Armul, R.D., Academy of Nutrition and Dietetics spokesperson. “This is the most important tip I share with clients who work from home.”

Put another way: When you’re at the office, it’s not so hard to ignore the brownies getting stale on the communal food table. At home, though, you're looking at that good stuff multiple times a day—especially if you’ve got a junk food stash. “You're walking through the kitchen more often, so you may need to overhaul that space and make it even healthier than it was before,” Armul says.

The solution? Put sweet treats and tempting snacks away from sight, in a drawer or on a high shelf—somewhere you're not seeing them dozens of times a day.

3. Set timers for fitness breaks

“Schedules and timers are my best friends, but I also need to be disciplined enough to listen to those timers,” says Donavanik. "I’ll tell myself, ‘I'm going to go to the gym at 1 p.m. no matter what I'm doing, no matter how involved I am in work,’ and then when the phone timer I set for 12:45 p.m. goes off, I need to stop what I’m doing and get ready to go.”

That means setting yourself up for breaks ahead of time. “I try to set a timer for every two hours to just go for a walk or grab coffee outside of my home,” he says. While Donavanik acknowledges that it’s easier to walk to a coffee shop in a big city, he suggests setting timers to get out of your chair and move every two hours. Determine your productivity zone and work with those parameters. If you need a break every 25 minutes or 45 minutes, then set timers through time management apps like tomato-timer.com and e.ggtimer.com.

4. Remember to eat lunch

“I find that people tend to let themselves get too hungry during the day, which can create that insatiable appetite, especially in the afternoon or early evening,” says Armul. “I recommend eating something every three to four hours so you never feel like you’re starving. That’s when your guard drops, and you tend to make those irrational food choices that are based on hunger rather than smart thinking.”

In addition to your healthy lunch, make sure you’re eating a snack that contains protein and fiber.

5. Meal prep for the week

Meal prep works for the commuter crowd, but it’ll do wonders for your waistline, too. If your work week begins on Monday, shop and prep on the weekends so you have plenty of premade meats, whole grains, washed and chopped veggies, and fruit at the ready. Portion out snacks like nuts, cheese, crackers, and pretzels into sandwich baggies or plastic containers so you’re not absentmindedly munching while working from home and typing. When you eat from the container or bag, it’s easy to lose portion control, says Armul. Pre-portioning out snacks and foods you tend to overeat will help you stay within your healthy calorie range while working from home.

6. Give yourself excuses to move more

Yes: Sitting is as unhealthy as you think it is, and your back and neck have probably told you that hunching over your computer is also painful. “Doing little movements throughout the day leads to more activity than people think,” says Donavanik. His suggestions: Stand up to drink tall glasses of water, or use a work break to do a simple chore like throw out the trash, check the mailbox, playing with your dog outside for 10 minutes. Consider buying a standing desk to give your body a break from sitting.

7. Find healthy ‘break’ ideas besides eating

“Walk around your neighborhood or walk around the block,” Armul says. “This can get creative juices flowing, too.” You might want to call a friend who works alternate hours, listen to a podcast on a walk, or read a book or magazine outside. If you have a dog, taking breaks with him will make you both happy. You could also find a shelter nearby and offer to walk their dogs in the middle of the day, or take a friend’s pup out for a stroll.

8. Define your workspace

Creating a workstation is paramount to success. It’s important to not only have a quiet space where you can get stuff done, but also to have an area to feel like “work” and designate boundaries so the rest of your living space feels like “home life.”

It may sound appealing to wake up and start responding to emails on your phone from the comfort of your bed, and then typing on your laptop while morning TV plays in the background, but that’s not healthy. Trust us: You’ll strain your back, neck, shoulders—and you’re not doing your sperm count any favors by resting your laptop on your lap. Have a defined workspace with a table or desk where you can sit upright comfortably.

9. Do 15-minute fitness bursts

“Create a space to exercise that’s a little bit away from your workspace where you can do 15-minute fitness breaks somewhere else in your home,” suggests Donavanik. This will help rev energy and fire up your metabolism. If you live in a house, your break spot might be your basement or living room. Better yet, use your backyard to squeeze in a workout. If you live in a small apartment, utilizing the space in an area that isn’t where you work might be tough, but try to change rooms from the one you work in so you’re not exercising at your desk.

One caveat: “If you're going to do 15-minute bursts, don't go all out,” advises Donavanik. “Do something at a good pace that's going to get the heart rate up, but without being a CrossFit WOD. To stay active, aim for 60% of your max heart rate and do bodyweight exercises like calisthenics, pushups, squats, and core routines. If you have weights, you can do a little more, but if you’re wanting a hearty workout, set aside time to go to the gym." If you’re going to pick up dumbbells, give your body time to warm up for a minute or two, depending on your fitness level and previous injuries.

Here’s the best bodyweight workout of all time or consider our full-body 15-minute dumbbell workout if you have time to warm up and cool down.

10. Create a “no-eating zone” in your workspace

This will force you to eat lunch or snacks in a different space, which will give you mental breaks you’ll need during the workday. At the very least, carve out time to eat lunch in another room, sit down with a plate, fork, and knife, and shut off all electronics while you eat lunch. A rule like this can reduce the tendency to eat at your desk, which adds up to hundreds of mindlessly munched calories before you know it, says Armul. When you’re concentrating on eating, you’ll be in tune to your fullness signals and less likely to overeat during the meal, says Armul.

11. Find ways to stay accountable

Any ripped guy will tell you that maintaining a lean, shredded physique takes daily dedication to training and nutrition. It’s not easy for anyone to maintain that motivation, let alone when you’re working by yourself all day and don’t have anyone to witness your bad habits.

If you’re motivated to stick to a fitness schedule by sharing it on social media, consider using a fitness app that allows you to share your workout on Facebook or Twitter, like Map My Run or Nike Training Club. You could also sign up for a 30-day challenge, since you’ll be more likely to turn that activity into a habit after doing it for one month.

12. Identify your reasons for staying motivated

“One of the most common questions I get on social media is, ‘How do I get motivated?’ I feel like there should be an answer that’s a ‘fix all’ for everyone, but it’s one of those intrinsic things that I can't tell you how to do. You just have to find a way to motivate yourself,” says Dovanavik.

First, be honest with yourself: “If you're going to the gym and expecting results after every workout, that's a surefire way to quickly become unmotivated. But if you can change your mindset about the gym itself—‘I get to do this’ instead of ‘I need to do this’—I think most people will be a lot more motivated.”