Cardio machines. Boxing classes. Yoga sessions. Indoor pool underwater stationary cycling (yes, that’s really a thing). There are as many ways to work out as there are excuses for staying on the couch. But even though there are lots of options—and lots of science telling us that getting enough physical activity leads to healthier, longer, happier lives—only one in five adults gets enough exercise, according to the Centers for Disease Control.

While there are lots of ways to stay or get fit—long walks, pushups and situps, regular tennis games, taking the stairs instead of the elevator—all require commitment. For those who need an extra push, many wannabe hardbodies decide the social and financial commitment of joining a gym or fitness studio will get them moving.

But if you’re thinking of joining a gym, be aware that the fitness industry thrives on good intentions. Most people who sign on with fitness clubs or studios stop using them after only a few months—and many workout dropouts continue to pay monthly membership fees hoping they’ll soon revive their motivation.

So first make a realistic plan. For most people, beginning a new exercise routine is like quitting a bad habit: the more doable it is (and the more you enjoy spinning/basketball/hot yoga), the more likely you’ll succeed. It also helps if your new exercise regimen includes opportunities to see friends or meet new ones. So does an attractive facility.

Start by setting realistic fitness goals, deciding on types of exercises to achieve them, and committing to a schedule. Make a list of reasons you can refer to when your enthusiasm flags. And if you are older than 40, review your plan with a physician before beginning.

Think about your own motivations and interests—and consider alternatives. Do you need to pay a company big bucks for activities available more cheaply than at a private gym or fitness club?

Many people can get fit for free or cheaply by doing pushups and situps at home, and walking, running, and biking around their neighborhoods. A regular soccer or basketball game at a nearby park is not only cheap but probably more fun than lugging weights around a smelly gym. For a one-time investment of a few hundred dollars, you can buy various types of home exercise equipment.

Local governments offer exercise facilities and programs. Recreation centers and local parks have cardio equipment, weight rooms, tennis courts, swimming pools, aerobics classes, basketball courts, sports leagues, and much more—all free or much cheaper than comparably equipped private health clubs.

For example, San Jose operates six community centers with fitness centers and a variety of classes; most also have gyms. A citywide fitness pass, which provides access to facilities at all six fitness centers, costs $250 a year. Monthly passes cost $26 for adults and $20 for seniors, teens, and the disabled. Drop-in rates are $5.50 for adults and $2.75 for seniors, teens, and the disabled.

San Francisco operates 25 recreation centers. Access to fitness centers and weight rooms is free. To swim in any of San Francisco’s pools, adults pay $6 per swim ($1 for ages 18 and under); a 10-swim pass is $55 for adults ($26 for seniors).

Richmond has four community centers that offer fitness memberships to adults either for free or for $5 per month for residents ($6.25 for nonresidents).

The Mill Valley Recreation Center boasts a gym, pool, and numerous group fitness classes for city residents for $512 a year for adults, $392 for seniors, and $287 for children under 18.

Click here for a list of the government-operated fitness facilities we could find in the Bay Area.

Think you’ll eventually join a private health and fitness club? Still spend a few weeks trying the alternatives. It’ll give you a better idea as to whether you’ll stick it out at a gym and which activities and facilities matter to you. Then check out our ratings of area gyms and fitness centers to identify those that offer high-quality facilities and staff at reasonable prices.