Yes. There is nothing magical about going to a gym. You can do calisthenics in a tiny room (so having a dedicated workout space isn’t an issue) and there are endless free resources online (so having money isn’t an issue) with various plans that will take you from no activity to a very high level of fitness. If you need specific equipment to get the muscle development you need, you’ll learn about that very quickly as you study, and then you can decide if you need to join a gym or buy some equipment.
I suggest getting some exercise at home, and only join a gym when you hit a point where you don’t feel you’re making any progress (or if you discover that you need the motivation of going to a gym to get you to exercise). I learned a lot from a writer named Mark Lauren, from his book You Are Your Own Gym, but there are many other trainers out there.
I think that working out at home has a lot of advantages. I don’t get embarrassed by having to display my saggy old-guy body in front of fit younger folks, I can take a shower afterward & change clothes without having to pack a gym bag and toiletries & drive somewhere. My house smells better than most gyms I’ve visited. It’s basically free. I have some sweatpants & shorts that I got at a discount store. No need to worry about looking out of style if no one can see you!
If you like online communities, I had good luck years ago comparing notes with other folks working out at home on a site called Fitocracy. They try to make fitness workouts be like a game, where you earn points. I think the site is still around.
I’ve disliked gyms since I was a kid, since I was the one in gym class who was always chosen last, and I’m also cheap, so the couple of times I’ve joined a gym as an adult, I’ve soon realized; hey, I can be doing push-ups at home, why am I paying to do it here?
Here’s a photo of my shoulders & back after working out at home for about six months (photo taken in the spring of 2015). Certainly not bulked up or ripped, but not bad for a guy in his mid-50s doing a few workout sessions a week.