Retirement planning is complicated for business owners. You can start a 401(k) plan at your company, but there are strict limits to how much can go into your portfolio. You can use money to invest in stocks outside the company, either in an IRA or a traditional brokerage account, but that's cash that you're pulling out of the business.

Investing in real estate is the best way for you to keep money in the business while diversifying your portfolio for retirement. You can decrease your company's occupancy cost while setting up an asset for your retirement. Let's go over the three steps you should take to use real estate to retire.

Two people embracing in front of a door.

Image source: Getty Images.

1. Buy real estate

The first step is the most obvious: buy the real estate. For many businesses, it makes sense to buy real estate instead of leasing. Not only do you build equity in an asset instead of spending money on lease payments, but you retain the tax benefits of depreciation and interest.

You may have a question here about whether it's worth it to buy real estate if you run your business easily from home. It's a good question and you'll need to evaluate your options. If your business produces enough cash flow to easily make the lease payment, I think it's worth it.

First, usually businesses that you can run easily from home by yourself don't translate into much of a sale price. If you buy real estate to work out of, you can use the cash flow from the business to build up an asset with some tax benefits.

Speaking of tax benefits, having a property where you work will make it a lot easier to do your taxes. Establishing a home office is nice, but there are so many rules regarding what you can do in the home office and what percent of your household expenses can be written off that you can get a migraine just thinking about it.

Buy a property, work in an office there most of the time, lease out the excess space, and then you can write off every expense the property incurs and have the property to produce income when you retire. Win-win-win.

It does get a bit more complicated once you make the decision to buy. Establish an LLC to be a holding company for the real estate. You want to separate the entities that own your real estate from those that own your business. Not only is this a good practice generally for insurance and liability purposes, but it will make it easier down the line to sell the business and keep the real estate.

Find a lender that is familiar with this process (they should all be) and execute a long-term lease between the operating company and the holding company.

2. Pay down the debt

Often real estate investors make most of their money through paying down the debt. You put as little money as possible into the down payment and then have a tenant make the debt payments. This will still be true for you even if it's one of your companies paying down the debt for another.

This is because you're replacing a lease payment to a third party with a lease payment to yourself -- the business is paying the money no matter what, so you may as well use it to pay down debt on an income-producing asset that you own.

3. Sell and retire

I was a business banker for a lot of years, so I understand the complications involved in selling a business. Most of the time you'll be forced to sell it for a lot less than it's worth.

Banks will want as much collateral as possible, so they'll want to include as many assets as possible in the sale. This is where you need to make a decision. If you sell the business and the property, you may be able to work in a nice premium for both and use a tax strategy known as a 1031 exchange to move the real estate sale proceeds into other income-producing assets.

If you're willing to sell the business to a buyer on an installment payment basis, things can be simpler. The seller makes regular payments to you for the business, giving you a stream of income and letting you avoid the tax hassles. You can also hold onto the real estate, entering into a lease with the new business owner and further boosting your total income.