I have been a solo contractor for little over 15 years now. This was my goal all along and it did not happen overnight. My path was more organic, I was a W2 for quite some time and in that time I had one personal focus - become more valuable to the company than they are to you. I took on tasks everyone was running away from, I changed code which was preceded by comments like “// DO NOT TOUCH THIS OR COMPANY WILL GO OUT OF BUSINESS” and after so time every big thing that was needed or every customer fire/emergency needed me. I was even called into an emergency meeting on my honeymoom :)
once I was comfortable I am fairly indispensible part of the business I submitted my resignation along with an offer to continue working as an independent contractor which was swiftly accepted. once I got this first (and as steady as it gets) thing everything went much smoother after this, word of mouth mostly and I went to a lot of meetups (especially pre covid) from where I got a number of contracts too