Incorporating as a business at the state level
A nonprofit organization is a corporation, just a special classification of corporation, and you have to go through the same incorporation procedure that any other business operating in your state has to go through. You should check with your Secretary of State's office to find out the correct requirement and procedures. The terminology can be rather confusing, but you will most likely want to incorporate as a "nonprofit public benefit corporation". Note that incorporation does not convey tax-exempt status to you. You must file federal and state applications for exemption separately.
To incorporate at the state level in California, you have to file form ARTS-PB-501(c)(3) Articles of Incorporation of a Nonprofit Public Benefit Corporation to the California Secretary of State's office and pay a $30 filing fee. You have to provide a physical address for the corporation; a PO box will not work. Your local UPS store can provide a mailbox with a physical address, for a fee, if you don't have another option. You also have to choose an official name for your corporation, a name which does not currently belong to any other incorporated entity in the state or is not overly similar to one. The name you use for incorporation need not be the name you actually use to refer to yourself, but it will be the name that appears in any official records.
It took us the RCO about two months to be granted our state incorporation, but we had one hitch along the way with the official name of our organization and had to re-submit our application. It would have taken about three weeks otherwise.
In California, newly-incorporated entities have to file a Statement of Information Form SI-100 within 90 days of their incorporation, and every two years after that. Check if your state has any similar requirements, and be aware of any other annual filing requirements
After your incorporation, you will probably need to separately apply for state income tax exemption, but it is probably easier to do this after you have received your federal 501(c)(3) nonprofit status, unless you foresee a significant delay in that process.
If you operate in California and plan to do any fundraising, you additionally have to register with the Office of the Attorney General by filing form CT-1 within 30 days of first receiving any donated assets. I do not know if other states have similar registration requirements. I also do not know why the various offices in the State of California can't just share information with each other to reduce the number of forms you have to file.