I’ve worked remotely for Salesforce for almost two years — and most of that time from my home. Working from home is fantastic for my concentration, and it saves me from LA traffic. Yet I had to adjust my routine to stay healthy when I adopted a home office-centric lifestyle.

You see, back when I worked in our office in Indianapolis, I walked to and from work every day, did workout classes in the office gym, and packed healthy lunches most (not all!) of the time.

Now the only walking I do is from my bedroom to my guest bedroom, where my office is. I’m surrounded by tasty snacks in my kitchen, and it’s tempting to sit at my desk late into the evening.

But two years in, I’ve learned that home-office pitfalls aren't insurmountable; they just require mindfulness. Whether you're working from home all or some of the time, here are a few of my solutions for staying healthy.

1. Keep a healthy kitchen and save treats for going out.

The good news: At home, you're not tempted by the office’s catered meals, birthday cakes, and free snacks. On the other hand, you're surrounded by the food in your own kitchen all day.

In general, I try to make sure the food in my kitchen is not food I’ll feel bad about eating. I recommend going grocery shopping when you're not hungry and when you've been eating healthier throughout the day. You'll buy much healthier food if you just ate a fresh salad as opposed to a big plate of pasta.

2. Prep energizing foods and eat every couple hours.

Make sure not to starve yourself until you can’t take it anymore. I’ve learned from experience that I must avoid waking up, drinking two cups of coffee, and working ceaselessly until 2 p.m. before a “hangry” me thinks about eating. My blood sugar isn’t thrilled — and I can’t do my most focused and creative work.

Instead, prep small containers of snacks and easy-to-assemble meals that will keep you energized and full. The key is preparation.

In the middle of a busy workday, if you open the fridge and see pre-cut vegetables and a container of hummus, you’ll be much more likely to go for that over a bag of chips. Other great options are almonds, bite-size fruit, and pure dark chocolate for an afternoon treat.

3. Make exercise a habit.

You've heard that habits are key to getting fit and healthy. In my experience, habits are ten times more important when you work from home. Why? Because you don’t have those visual office cues telling you it’s time to come into work, leave for lunch, or go home for the day.

Qualified scientists have written extensively about how to make lasting habits, so I won't tell you how. The goal is to make exercise an everyday thing. It’s important for everyone, but even more so for those who work from home.

Work out whenever works for you. I prefer to spend an hour or so going through my inbox and making a to-do list each morning before taking a gym break. Maybe you’re more of a lunchtime exerciser, or you enjoy a late-afternoon energy boost from a run. Whatever you do, the only thing that matters is that you do it.

4. Sleep enough, every day.

If you’re serious about your career, you know sleeping until noon isn’t an option while working from home any more than it is while working in an office. But for home-office workers, it helps to set a schedule for sleep.

Make it a goal to go to bed at the same reasonable hour every night, and set your alarm for the same time every morning. This will keep your health and fitness goals stay on track and give your life a daily rhythm.

5. Use downtime to log a few extra steps.

No one should work for eight hours straight without a single break. In fact, our brains really need breaks. In an office, you may spend downtime catching up with co-workers, grabbing coffee and networking, or walking to a nearby lunch spot. In your home office, it can be tempting to use downtime to turn on the TV, fold the laundry, or browse Amazon.

I challenge you to use downtime for something more productive: a walk. Even a short walk boosts productivity, creativity, and overall mood. Have fifteen minutes before your next call? Feeling stressed about a project and lacking fresh ideas? Take a walk. I enjoy quick walks all the time when I begin to feel overwhelmed, frustrated, or even a little lonely about missing something in the office. Believe me — it really helps.

How do you stay healthy while working from home? I'd love to hear your advice. Send me a tweet: @youngheike.