Freelancer Visa in portugal

HI,

Any one has info how to start the freelancer work in Portugal which gives a resident permit.