Andersson joined the Pirate Party of Sweden in 2009 shortly after the trials against the founders of the torrenting website, The Pirate Bay, Neij, Sunde, and Svartholm Walg ended and the verdict was delivered. On a press tour, when asked why he joined the Pirate Party, he responded that he felt that the verdict against the Pirate Bay founders demonstrated the corruption of the judicial court and believed that "it was a shame to see how our entire legal system lacked insight into the basic principles of the Internet" and its culture of sharing. In 2014 he was chosen to hold the position of the party's Activist Coordinator, a position he held until his election into the leadership role in May 2016.
Election
On 2 May 2016, the Pirate Party held its election using a digital meeting platform where all members of the Pirate Party of Sweden had the right to vote in order to demonstrate its commitment to a transparent government. Leading by a wide margin, Andersson was selected. A statement was posted onto his blog:
"Alright friends and beloved ones, if you haven’t seen it or understand what is happening at the moment: A few hours ago I was elected leader of the Swedish Pirate Party! It’s a fantastic show of faith from my fellow party members to give me this mandate and I will most definitely do my very, very best to live up to their expectations as well as my own. The future is coming, and it brings so much fun and excitement that I can hardly wait!"
In an open letter to the party members, Andersson expressed a desire to improve upon the building of the Pirate Party's policies, stating that "time is with us, for our policies are becoming more relevant every passing day...we need to be even more active in highlighting the positive aspects of the network". He also aims to continue with the Pirate Party's goals on combatting internet privacy violations and surveillance as well as to educate people on why the freedom of the Internet is worth preserving. Beginning on 20 May 2016, the newly elected officials, Andersson, deputy leader Mattias Bjarnemalm and party secretary Anton Nordenfur embarked on a political tour with the goal of visiting as many Swedish cities as possible including.