Yes, you are not required to be a California resident to obtain a California real estate license.
The steps to obtain your California real estate license are the same as California residents, the only difference includes the following:
You can complete the required 3, 45-hour courses (135 hours in total) online from your home state; however, you must take the proctored state exam at one of the DRE's testing centers located within the State of California.
If you plan on obtaining an active California real estate license, your sponsoring broker must hold a California broker's license.