Yes, you can do it, the key is recognizing your weaknesses and that at some point you will cease to primarily be an active engineer (meaning you won't code day to day etc). Great CTO's always remain very technical IMO, but they have to develop a whole new set of skills. Most of the time you will find it is hard to scale yourself fast enough if you are on a rocket ship, so the key way to remain CTO is to hire for your gaps beyond just engineers, hire product people, hire project managers, hire an ex-CTO that wants to mentor and play a role less than the CTO.
I have been a founder prior and I have been a CTO for different companies as well as a Chief Software Architect at GE (essentially a large project's CTO where my staff was over 130 people). Being CTO is hard to do well, and depending on the organization it can be downright the most stressful job. It also can be the most rewarding and fun job, so I definitely love it.
Some things I recommend (you probably already have some just listing things that pop into my mind) and this is by no means comprehensive:
1. Always make yourself redundant in all the positions you move through on the way to CTO (that's how you will be one).
2. Find a good mentor who can help you and will be painfully honest with you. Find this person hopefully before you are the CTO, that way they can help guide you on the way up.
3. Learn to take feedback across the board. Don't ignore the mentors advice and be careful not to ask 10 people for advice as at some point it becomes noise and you won't make a good decision.
4. Learn to make decisions with less than the full picture, and live with the consequences. And accept you need to change the decision or reverse course and that's ok, don't live with a bad decision when the facts show you made a mistake, correct and move forward.
5. Say no often. Learn that the business goals/needs comes first, not fun cool new technology. Of course, if the business is to develop fun new tech that's cool too.
6. Learn how to work with all types of people, this can be hard but it is absolutely required because you need diversity and you need to hire different skillsets other than just engineers as a CTO.
7. Learn to speak business, this is a fun challenge if you don't know already and it is immensely helpful.
8. Learn basic accounting so you understand why things are being asked of you sometimes. This also makes you far more valuable to the organization and in the future.
9. Learn to scale the organization, this is trial and error to some degree if you've never done it before. Hiring and team structure can be hard, experimenting and taking team feedback is how you succeed.
10. Respect your weaknesses and find people to compliment them. We all have weaknesses, respect you have them, acknowledge them and hire people to balance you.
11. Hire people that disagree with you. I don't mean hire assholes, but hire people who challenge your way of thinking, that force you to make better decisions.
12. Learn how to manage products, read some books on new product introductions, processes and find a product mentor. Product is what is important, not whether you used framework A or B, but you need to balance all that, so understanding product is critical to success.
FYI: I am the CTO of a backed healthcare startup.