The formation of a company has many points that in general are similar independently of the country, while others highly depend on the place where the company is going to be located. (Centro de Información y Red de Creación de Empresas)
For example, the first steps include conducting a SWOT (strengths, weaknesses, opportunities, threats) analysis and creating a Business Plan, which has to be done by any person interested in creating a company independently of the place.
However, the next step, selecting the legal form, is highly dependent on the place; in Spain, the available legal forms to create an entity are basically the ones included in the previous point. Following with the creation of the company, depending on the selected legal form it will be necessary to go through different types of paperwork (unless we are talking about an autonomous entrepreneur, who has no constitution paperwork). In the following website is possible to see the required things in Spain for each type of company: Website “Creación de Empresas”. In this same page is also possible to see the different procedures necessary to follow depending on the legal form, in order for the company to start business.
Independently to all those procedures, some types of legal forms have the possibility to do some parts of them online.