You do not need a gym. The beginner and intermediate programs are designed to be done at home with a pull-up bar and a set of resistance bands. That is the full equipment requirement for the majority of the program library.
A doorframe pull-up bar costs very little and installs in seconds. Resistance bands are cheap and take up almost no space. If you have those two things and enough floor space for a push-up, you have everything you need to start.
Some members choose to train at a gym because they prefer the environment or already have a membership. That is fine. But it is never a requirement, and you will not be at a disadvantage training from home.
For more advanced programs involving gymnastic rings or parallettes, having those at home helps. But you are unlikely to need them for months into the program, and by the time you do, you will know whether you want to invest in them.